Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 7 pull requests #65854

Closed
wants to merge 29 commits into from
Closed

Commits on Oct 22, 2019

  1. Configuration menu
    Copy the full SHA
    58c6591 View commit details
    Browse the repository at this point in the history
  2. fix compile-fail test

    estebank committed Oct 22, 2019
    Configuration menu
    Copy the full SHA
    88e4e2a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5b58095 View commit details
    Browse the repository at this point in the history
  4. Drive-by formatting

    estebank committed Oct 22, 2019
    Configuration menu
    Copy the full SHA
    0118278 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    669a403 View commit details
    Browse the repository at this point in the history
  6. Fix rebase

    estebank committed Oct 22, 2019
    Configuration menu
    Copy the full SHA
    580a93e View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2019

  1. Add comments

    estebank committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    3a4cacd View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2019

  1. Configuration menu
    Copy the full SHA
    93cac9c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1ca8da4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7073158 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2019

  1. Configuration menu
    Copy the full SHA
    949874a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fa637fa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1033298 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cb440f0 View commit details
    Browse the repository at this point in the history
  5. Apply suggestions from code review

    Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
    matthewjasper and Centril authored Oct 25, 2019
    Configuration menu
    Copy the full SHA
    0c05ed2 View commit details
    Browse the repository at this point in the history
  6. Renamed ui/dead-code-ret to ui/unreachable-code-ret

    This test was actually about the unreachable_code flag, not dead_code,
    so I renamed it for clarity (to prepare for the next commit, where I
    plan to move a bunch of the dead_code tests to a single folder)
    Quantumplation committed Oct 25, 2019
    Configuration menu
    Copy the full SHA
    9f257dd View commit details
    Browse the repository at this point in the history
  7. Move dead_code related tests to test/ui/dead-code

    This helps organize the tests better.  I also renamed several of the tests to remove redundant dead-code in the path, and better match what they're testing
    Quantumplation committed Oct 25, 2019
    Configuration menu
    Copy the full SHA
    cb5fd4e View commit details
    Browse the repository at this point in the history
  8. Remove lint callback from driver

    This is leftover from a restructuring of lint registration for drivers;
    it should now happen via the register_lints field on Config rather than
    this function.
    Mark-Simulacrum committed Oct 25, 2019
    Configuration menu
    Copy the full SHA
    402a8af View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2019

  1. Configuration menu
    Copy the full SHA
    8f988bd View commit details
    Browse the repository at this point in the history
  2. Move crate type checking later

    This allows us to directly pass in a lint buffer
    Mark-Simulacrum committed Oct 26, 2019
    Configuration menu
    Copy the full SHA
    2ac9b7a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a44126a View commit details
    Browse the repository at this point in the history
  4. Use ident instead of def_span in dead-code pass

    According to @estebank, def_span scans forward on the line until it finds a {,
    and if it can't find one, fallse back to the span for the whole item.  This
    was apparently written before the identifier span was explicitly tracked on
    each node.
    
    This means that if an unused function signature spans multiple lines, the
    entire function (potentially hundreds of lines) gets flagged as dead code.
    This could, for example, cause IDEs to add error squiggly's to the whole
    function.
    
    By using the span from the ident instead, we narrow the scope of this in
    most cases.  In a wider sense, it's probably safe to use ident.span
    instead of def_span in most locations throughout the whole code base,
    but since this is my first contribution, I kept it small.
    
    Some interesting points that came up while I was working on this:
     - I reorganized the tests a bit to bring some of the dead code ones all
       into the same location
     - A few tests were for things unrelated to dead code (like the
       path-lookahead for parens), so I added #![allow(dead_code)] and
       cleaned up the stderr file to reduce noise in the future
     - The same fix doesn't apply to const and static declarations.  I tried
       adding these cases to the match expression, but that created a much
       wider change to tests and error messages, so I left it off until I
       could get some code review to validate the approach.
    Quantumplation committed Oct 26, 2019
    Configuration menu
    Copy the full SHA
    94890d2 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#65288 - estebank:point-at-assoc-type, r=nik…

    …omatsakis
    
    Point at associated type for some obligations
    
    Partially address rust-lang#57663.
    Centril authored Oct 26, 2019
    Configuration menu
    Copy the full SHA
    677cbd0 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#65541 - eddyb:spanned-inferred-outlives, r=…

    …nikomatsakis
    
    rustc: add `Span`s to `inferred_outlives_of` predicates.
    
    This would simplify rust-lang#59789, and I suspect it has some potential in diagnostics (although we don't seem to use the predicate `Span`s much atm).
    Centril authored Oct 26, 2019
    Configuration menu
    Copy the full SHA
    a6c9ebd View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#65738 - ohadravid:re-rebalance-coherence-al…

    …low-fundamental-local, r=nikomatsakis
    
    Coherence should allow fundamental types to impl traits when they are local
    
    After rust-lang#64414, `impl<T> Remote for Box<T> { }` is disallowed, but it is also disallowed in liballoc, where `Box` is a local type!
    
    Enabling `#![feature(re_rebalance_coherence)]` in `liballoc` results in:
    ```
    error[E0210]: type parameter `F` must be used as the type parameter for some local type (e.g., `MyStruct<F>`)
        --> src\liballoc\boxed.rs:1098:1
         |
    1098 | impl<F: ?Sized + Future + Unpin> Future for Box<F> {
         | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `F` must be used as the type parameter for some local type
    ```
    
    This PR relaxes `uncover_fundamental_ty` to skip local fundamental types.
    I didn't add a test since `liballoc` already fails to compile, but I can add one if needed.
    
    r? @nikomatsakis
    
    cc rust-lang#63599
    Centril authored Oct 26, 2019
    Configuration menu
    Copy the full SHA
    823a3f2 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#65777 - matthewjasper:allow-impl-trait-expa…

    …nsion, r=davidtwco
    
    Don't ICE for completely unexpandable `impl Trait` types
    
    Save the resolution of these types (to themselves) to the typeck tables so that they will eventually reach E0720.
    
    closes rust-lang#65561
    Centril authored Oct 26, 2019
    Configuration menu
    Copy the full SHA
    8a5f08f View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#65830 - Quantumplation:master, r=davidtwco

    Use ident.span instead of def_span in dead-code pass
    
    Hello! First time contributor! :)
    
    This should fix rust-lang#58729.
    
    According to @estebank in the duplicate rust-lang#63064, def_span scans forward on the line until it finds a {,
    and if it can't find one, falls back to the span for the whole item. This
    was apparently written before the identifier span was explicitly tracked on
    each node.
    
    This means that if an unused function signature spans multiple lines, the
    entire function (potentially hundreds of lines) gets flagged as dead code.
    This could, for example, cause IDEs to add error squiggly's to the whole
    function.
    
    By using the span from the ident instead, we narrow the scope of this in
    most cases. In a wider sense, it's probably safe to use ident.span
    instead of def_span in most locations throughout the whole code base,
    but since this is my first contribution, I kept it small.
    
    Some interesting points that came up while I was working on this:
    - I reorganized the tests a bit to bring some of the dead code ones all
    into the same location
    - A few tests were for things unrelated to dead code (like the
    path-lookahead for parens), so I added #![allow(dead_code)] and
    cleaned up the stderr file to reduce noise in the future
    - The same fix doesn't apply to const and static declarations. I tried
    adding these cases to the match expression, but that created a much
    wider change to tests and error messages, so I left it off until I
    could get some code review to validate the approach.
    Centril authored Oct 26, 2019
    Configuration menu
    Copy the full SHA
    838ed89 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#65834 - Mark-Simulacrum:driver-clean, r=nik…

    …omatsakis
    
    Remove lint callback from driver
    
    This is leftover from a restructuring of lint registration for drivers; it should now happen via the register_lints field on Config rather than this function.
    
    This is not used by anyone to my knowledge (including the compiler itself); it was introduced in an abandoned refactor in rust-lang#65193.
    Centril authored Oct 26, 2019
    Configuration menu
    Copy the full SHA
    8ce925a View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#65835 - Mark-Simulacrum:lockless-lintbuffer…

    …, r=nikomatsakis
    
    Remove LintBuffer from Session
    
    This moves the `LintBuffer` from `Session` into the `Resolver`, where it is used until lowering is done and then consumed by early lint passes. This also happily removes the failure mode of buffering lints too late where it would have previously lead to ICEs; it is statically no longer possible to do so.
    
    I suspect that with a bit more work a similar move could be done for the lint buffer inside `ParseSess`, but this PR doesn't touch it (in part to keep itself small).
    
    The last commit is the "interesting" commit -- the ones before it don't work (though they compile) as they sort of prepare the various crates for the lint buffer to be passed in rather than accessed through Session.
    Centril authored Oct 26, 2019
    Configuration menu
    Copy the full SHA
    ee82c8c View commit details
    Browse the repository at this point in the history