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 9 pull requests #73366

Closed
wants to merge 28 commits into from
Closed

Commits on May 25, 2020

  1. Configuration menu
    Copy the full SHA
    98eb29c View commit details
    Browse the repository at this point in the history
  2. stabilize vec_drain_as_slice

    CAD97 committed May 25, 2020
    Configuration menu
    Copy the full SHA
    738f848 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2020

  1. Make fn_arg_names return Ident instead of symbol

    Also, implement this query for the local crate, not just foreign crates.
    Aaron1011 committed Jun 11, 2020
    Configuration menu
    Copy the full SHA
    754da88 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2c11c35 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5902b2f View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2020

  1. Run fmt

    Aaron1011 committed Jun 12, 2020
    Configuration menu
    Copy the full SHA
    4646e2d View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2020

  1. Configuration menu
    Copy the full SHA
    cecfa43 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d73674e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a77f046 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f5370fa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a43e486 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    21ddf4d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    9e2ee32 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2dcf7db View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2020

  1. Configuration menu
    Copy the full SHA
    d82dd43 View commit details
    Browse the repository at this point in the history
  2. _match.rs: fix module doc comment

    It was applied to a `use` item, not to the module
    jonas-schievink committed Jun 14, 2020
    Configuration menu
    Copy the full SHA
    c7ad3ad View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5a846d7 View commit details
    Browse the repository at this point in the history
  4. structural_match: non-structural-match ty closures

    This commit adds a `Closure` variant to `NonStructuralMatchTy` in
    `structural_match`, fixing an ICE which can occur when
    `impl_trait_in_bindings` is used with constants.
    
    Signed-off-by: David Wood <[email protected]>
    davidtwco committed Jun 14, 2020
    Configuration menu
    Copy the full SHA
    79e08bb View commit details
    Browse the repository at this point in the history
  5. Update E0446.md

    The existing error documentation did not show how to use a child module's functions if the types used in those functions are private. These are some other places this problem has popped up that did not present a solution (these are from before the solution existed, 2016-2017. The solution was released in the Rust 2018 edition. However these were the places I was pointed to when I encountered the problem myself):
    rust-lang#30905
    https://stackoverflow.com/questions/39334430/how-to-reference-private-types-from-public-functions-in-private-modules/62374958#62374958
    gabenodarse authored Jun 14, 2020
    Configuration menu
    Copy the full SHA
    8361ee5 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2020

  1. Rollup merge of rust-lang#71824 - ecstatic-morse:const-check-post-dro…

    …p-elab, r=oli-obk
    
    Check for live drops in constants after drop elaboration
    
    Resolves rust-lang#66753.
    
    This PR splits the MIR "optimization" pass series in two and introduces a query–`mir_drops_elaborated_and_const_checked`–that holds the result of the `post_borrowck_cleanup` analyses and checks for live drops. This query is invoked in `rustc_interface` for all items requiring const-checking, which means we now do `post_borrowck_cleanup` for items even if they are unused in the crate.
    
    As a result, we are now more precise about when drops are live. This is because drop elaboration can e.g. eliminate drops of a local when all its fields are moved from. This does not mean we are doing value-based analysis on move paths, however; Storing a `Some(CustomDropImpl)` into a field of a local will still set the qualifs for that entire local.
    
    r? @oli-obk
    RalfJung authored Jun 15, 2020
    Configuration menu
    Copy the full SHA
    346cf30 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#72389 - Aaron1011:feature/move-fn-self-msg,…

    … r=nikomatsakis
    
    Explain move errors that occur due to method calls involving `self`
    
    When calling a method that takes `self` (e.g. `vec.into_iter()`), the method receiver is moved out of. If the method receiver is used again, a move error will be emitted::
    
    ```rust
    fn main() {
        let a = vec![true];
        a.into_iter();
        a;
    }
    ```
    
    emits
    
    ```
    error[E0382]: use of moved value: `a`
     --> src/main.rs:4:5
      |
    2 |     let a = vec![true];
      |         - move occurs because `a` has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
    3 |     a.into_iter();
      |     - value moved here
    4 |     a;
      |     ^ value used here after move
    ```
    
    However, the error message doesn't make it clear that the move is caused by the call to `into_iter`.
    
    This PR adds additional messages to move errors when the move is caused by using a value as the receiver of a `self` method::
    
    ```
    error[E0382]: use of moved value: `a`
       --> vec.rs:4:5
        |
    2   |     let a = vec![true];
        |         - move occurs because `a` has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
    3   |     a.into_iter();
        |     ------------- value moved due to this method call
    4   |     a;
        |     ^ value used here after move
        |
    note: this function takes `self`, which moves the receiver
       --> /home/aaron/repos/rust/src/libcore/iter/traits/collect.rs:239:5
        |
    239 |     fn into_iter(self) -> Self::IntoIter;
    ```
    
    TODO:
    
    - [x] Add special handling for `FnOnce/FnMut/Fn` - we probably don't want to point at the unstable trait methods
    - [x] Consider adding additional context for operations (e.g. `Shr::shr`) when the call was generated using the operator syntax (e.g. `a >> b`)
    - [x] Consider pointing to the method parent (impl or trait block) in addition to the method itself.
    RalfJung authored Jun 15, 2020
    Configuration menu
    Copy the full SHA
    ebd394f View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#72556 - matthew-mcallister:trait-alias-inhe…

    …rent-impl, r=estebank
    
    Fix trait alias inherent impl resolution
    
    Fixes rust-lang#60021 and fixes rust-lang#72415.
    
    Obviously, the fix was very easy, but getting started with the testing and debugging rust compiler was an interesting experience. Now I can cross it off my bucket list!
    RalfJung authored Jun 15, 2020
    Configuration menu
    Copy the full SHA
    b220894 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#72584 - CAD97:stabilize-58957, r=dtolnay

    Stabilize vec::Drain::as_slice
    
    and add `AsRef<[T]> for Drain<'_, T>`.
    
    Tracking issue: rust-lang#58957. Does not stabilize `slice::IterMut::as_slice` yet. cc @cuviper
    This PR proposes stabilizing just the `vec::Drain::as_slice` part of that tracking issue.
    
    My ultimate goal here: being able to use `for<T, I: Iterator<Item=T> + AsRef<[T]>> I` to refer to `vec::IntoIter`, `vec::Drain`, and eventually `array::IntoIter`, as an approximation of the set of by-value iterators that can be "previewed" as by-ref iterators. (Actually expressing that as a trait requires GAT.)
    RalfJung authored Jun 15, 2020
    Configuration menu
    Copy the full SHA
    d190ff5 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#73336 - lzutao:pattern-group, r=sfackler

    Group `Pattern::strip_*` method together
    RalfJung authored Jun 15, 2020
    Configuration menu
    Copy the full SHA
    1f7f76b View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#73341 - jonas-schievink:matchdoc, r=davidtwco

    _match.rs: fix module doc comment
    
    It was applied to a `use` item, not to the module
    RalfJung authored Jun 15, 2020
    Configuration menu
    Copy the full SHA
    7a28804 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#73342 - schteve:master, r=jonas-schievink

    Fix iterator copied() documentation example code
    
    The documentation for copied() gives example code with variable v_cloned instead of v_copied. This seems like a copy/paste error from cloned() and it would be clearer to use v_copied.
    RalfJung authored Jun 15, 2020
    Configuration menu
    Copy the full SHA
    d9e2441 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#73351 - gnodarse:patch-1, r=ecstatic-morse

    Update E0446.md
    
    The existing error documentation did not show how to use a child module's functions if the types used in those functions are private. These are some other places this problem has popped up that did not present a solution (these are from before the solution existed, 2016-2017. The solution was released in the Rust 2018 edition. However these were the places I was pointed to when I encountered the problem myself):
    rust-lang#30905
    https://stackoverflow.com/questions/39334430/how-to-reference-private-types-from-public-functions-in-private-modules/62374958#62374958
    RalfJung authored Jun 15, 2020
    Configuration menu
    Copy the full SHA
    742b1b6 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#73353 - davidtwco:issue-73003-non-structura…

    …l-match-ty-closures, r=varkor
    
    structural_match: non-structural-match ty closures
    
    Fixes rust-lang#73003.
    
    This PR adds a `Closure` variant to `NonStructuralMatchTy` in `structural_match`, fixing an ICE which can occur when `impl_trait_in_bindings` is used with constants.
    RalfJung authored Jun 15, 2020
    Configuration menu
    Copy the full SHA
    abcd3dc View commit details
    Browse the repository at this point in the history