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 6 pull requests #91790

Closed
wants to merge 30 commits into from

Commits on Sep 9, 2021

  1. Add a try_clone() function to OwnedFd.

    As suggested in rust-lang#88564. This adds a `try_clone()` to `OwnedFd` by
    refactoring the code out of the existing `File`/`Socket` code.
    sunfishcode committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    18c14ad View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    622dfcc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c986c6b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2d6a4c8 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2021

  1. Configuration menu
    Copy the full SHA
    53e072f View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2021

  1. Configuration menu
    Copy the full SHA
    89b2e0c View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2021

  1. Configuration menu
    Copy the full SHA
    8f68bdc View commit details
    Browse the repository at this point in the history

Commits on Dec 5, 2021

  1. Add spin_loop hint for RISC-V architecture

    This commit also updates `stdarch` git submodule.
    luojia65 committed Dec 5, 2021
    Configuration menu
    Copy the full SHA
    70855b2 View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2021

  1. Update stdarch dependency

    luojia65 committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    0ccf58b View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2021

  1. Point at capture points for non-'static reference crossing a `yield…

    …` point
    
    ```
    error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
      --> $DIR/issue-72312.rs:10:24
       |
    LL |     pub async fn start(&self) {
       |                        ^^^^^ this data with an anonymous lifetime `'_`...
    ...
    LL |         require_static(async move {
       |         -------------- ...is required to live as long as `'static` here...
    LL |             &self;
       |             ----- ...and is captured here
       |
    note: `'static` lifetime requirement introduced by this trait bound
      --> $DIR/issue-72312.rs:2:22
       |
    LL | fn require_static<T: 'static>(val: T) -> T {
       |                      ^^^^^^^
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0759`.
    ```
    
    Fix rust-lang#72312.
    estebank committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    d10fe26 View commit details
    Browse the repository at this point in the history
  2. Clean up visual output logic

    estebank committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    dd81e98 View commit details
    Browse the repository at this point in the history
  3. review comments

    * take diagnostic logic out of happy-path
    * sort/dedup once
    * add more comments
    estebank committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    ab45ab8 View commit details
    Browse the repository at this point in the history
  4. Add filtering based on involved required lifetime

    More accurate filtering still needed.
    estebank committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    09dbf37 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ee0fd10 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    10a74ac View commit details
    Browse the repository at this point in the history
  7. Update nll test

    estebank committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    0ee723e View commit details
    Browse the repository at this point in the history
  8. rebase and update nll test

    estebank committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    ff13ad7 View commit details
    Browse the repository at this point in the history
  9. Tweak wording

    estebank committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    83ce1aa View commit details
    Browse the repository at this point in the history
  10. Review comments

    estebank committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    9cc7bd7 View commit details
    Browse the repository at this point in the history
  11. Remove field from ErrorValue

    estebank committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    d33fa13 View commit details
    Browse the repository at this point in the history
  12. review comment

    estebank committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    da5b0cc View commit details
    Browse the repository at this point in the history
  13. fix tests after rebase

    estebank committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    40f161a View commit details
    Browse the repository at this point in the history
  14. fmt

    estebank committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    d2d9eb3 View commit details
    Browse the repository at this point in the history
  15. Suggest using a temporary variable to fix borrowck errors

    In Rust, nesting method calls with both require `&mut` access to `self`
    produces a borrow-check error:
    
        error[E0499]: cannot borrow `*self` as mutable more than once at a time
         --> src/lib.rs:7:14
          |
        7 |     self.foo(self.bar());
          |     ---------^^^^^^^^^^-
          |     |    |   |
          |     |    |   second mutable borrow occurs here
          |     |    first borrow later used by call
          |     first mutable borrow occurs here
    
    That's because Rust has a left-to-right evaluation order, and the method
    receiver is passed first. Thus, the argument to the method cannot then
    mutate `self`.
    
    There's an easy solution to this error: just extract a local variable
    for the inner argument:
    
        let tmp = self.bar();
        self.foo(tmp);
    
    However, the error doesn't give any suggestion of how to solve the
    problem. As a result, new users may assume that it's impossible to
    express their code correctly and get stuck.
    
    This commit adds a (non-structured) suggestion to extract a local
    variable for the inner argument to solve the error. The suggestion uses
    heuristics that eliminate most false positives, though there are a few
    false negatives (cases where the suggestion should be emitted but is
    not). Those other cases can be implemented in a future change.
    camelid committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    e273152 View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2021

  1. Rollup merge of rust-lang#83174 - camelid:borrow-help, r=oli-obk

    Suggest using a temporary variable to fix borrowck errors
    
    Fixes rust-lang#77834.
    
    In Rust, nesting method calls with both require `&mut` access to `self`
    produces a borrow-check error:
    
        error[E0499]: cannot borrow `*self` as mutable more than once at a time
         --> src/lib.rs:7:14
          |
        7 |     self.foo(self.bar());
          |     ---------^^^^^^^^^^-
          |     |    |   |
          |     |    |   second mutable borrow occurs here
          |     |    first borrow later used by call
          |     first mutable borrow occurs here
    
    That's because Rust has a left-to-right evaluation order, and the method
    receiver is passed first. Thus, the argument to the method cannot then
    mutate `self`.
    
    There's an easy solution to this error: just extract a local variable
    for the inner argument:
    
        let tmp = self.bar();
        self.foo(tmp);
    
    However, the error doesn't give any suggestion of how to solve the
    problem. As a result, new users may assume that it's impossible to
    express their code correctly and get stuck.
    
    This commit adds a (non-structured) suggestion to extract a local
    variable for the inner argument to solve the error. The suggestion uses
    heuristics that eliminate most false positives, though there are a few
    false negatives (cases where the suggestion should be emitted but is
    not). Those other cases can be implemented in a future change.
    matthiaskrgr authored Dec 11, 2021
    Configuration menu
    Copy the full SHA
    4b674fa View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#88794 - sunfishcode:sunfishcode/try-clone, …

    …r=joshtriplett
    
    Add a `try_clone()` function to `OwnedFd`.
    
    As suggested in rust-lang#88564. This adds a `try_clone()` to `OwnedFd` by
    refactoring the code out of the existing `File`/`Socket` code.
    
    r? ``@joshtriplett``
    matthiaskrgr authored Dec 11, 2021
    Configuration menu
    Copy the full SHA
    0eedc9d View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#89734 - estebank:issue-72312, r=nikomatsakis

    Point at capture points for non-`'static` reference crossing a `yield` point
    
    ```
    error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
      --> $DIR/issue-72312.rs:10:24
       |
    LL |     pub async fn start(&self) {
       |                        ^^^^^ this data with an anonymous lifetime `'_`...
    ...
    LL |         require_static(async move {
       |         -------------- ...is required to live as long as `'static` here...
    LL |             &self;
       |             ----- ...and is captured here
       |
    note: `'static` lifetime requirement introduced by this trait bound
      --> $DIR/issue-72312.rs:2:22
       |
    LL | fn require_static<T: 'static>(val: T) -> T {
       |                      ^^^^^^^
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0759`.
    ```
    
    Fix rust-lang#72312.
    matthiaskrgr authored Dec 11, 2021
    Configuration menu
    Copy the full SHA
    fefeb46 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#90081 - woppopo:const_write_bytes, r=oli-obk

    Make `intrinsics::write_bytes` const
    
    This is required to constify `MaybeUninit::zeroed` and `(*mut T)::write_bytes`.
    
    Tracking issue: rust-lang#86302
    matthiaskrgr authored Dec 11, 2021
    Configuration menu
    Copy the full SHA
    646af41 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#90270 - woppopo:const_borrow_trait, r=dtolnay

    Make `Borrow` and `BorrowMut` impls `const`
    
    Tracking issue: rust-lang#91522
    matthiaskrgr authored Dec 11, 2021
    Configuration menu
    Copy the full SHA
    b3d402e View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#91548 - luojia65:hint-spin-loop-riscv, r=Am…

    …anieu
    
    Add spin_loop hint for RISC-V architecture
    
    This commit uses the PAUSE instruction (rust-lang/stdarch#1262) to implement RISC-V spin loop, and updates `stdarch` submodule to use the merged PAUSE instruction.
    matthiaskrgr authored Dec 11, 2021
    Configuration menu
    Copy the full SHA
    2356936 View commit details
    Browse the repository at this point in the history