-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rollup of 6 pull requests #91790
Commits on Sep 9, 2021
-
Add a
try_clone()
function toOwnedFd
.As suggested in rust-lang#88564. This adds a `try_clone()` to `OwnedFd` by refactoring the code out of the existing `File`/`Socket` code.
Configuration menu - View commit details
-
Copy full SHA for 18c14ad - Browse repository at this point
Copy the full SHA 18c14adView commit details -
Configuration menu - View commit details
-
Copy full SHA for 622dfcc - Browse repository at this point
Copy the full SHA 622dfccView commit details -
Configuration menu - View commit details
-
Copy full SHA for c986c6b - Browse repository at this point
Copy the full SHA c986c6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d6a4c8 - Browse repository at this point
Copy the full SHA 2d6a4c8View commit details
Commits on Oct 5, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 53e072f - Browse repository at this point
Copy the full SHA 53e072fView commit details
Commits on Nov 24, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 89b2e0c - Browse repository at this point
Copy the full SHA 89b2e0cView commit details
Commits on Dec 4, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 8f68bdc - Browse repository at this point
Copy the full SHA 8f68bdcView commit details
Commits on Dec 5, 2021
-
Add spin_loop hint for RISC-V architecture
This commit also updates `stdarch` git submodule.
Configuration menu - View commit details
-
Copy full SHA for 70855b2 - Browse repository at this point
Copy the full SHA 70855b2View commit details
Commits on Dec 9, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 0ccf58b - Browse repository at this point
Copy the full SHA 0ccf58bView commit details
Commits on Dec 10, 2021
-
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.
Configuration menu - View commit details
-
Copy full SHA for d10fe26 - Browse repository at this point
Copy the full SHA d10fe26View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd81e98 - Browse repository at this point
Copy the full SHA dd81e98View commit details -
* take diagnostic logic out of happy-path * sort/dedup once * add more comments
Configuration menu - View commit details
-
Copy full SHA for ab45ab8 - Browse repository at this point
Copy the full SHA ab45ab8View commit details -
Add filtering based on involved required lifetime
More accurate filtering still needed.
Configuration menu - View commit details
-
Copy full SHA for 09dbf37 - Browse repository at this point
Copy the full SHA 09dbf37View commit details -
Configuration menu - View commit details
-
Copy full SHA for ee0fd10 - Browse repository at this point
Copy the full SHA ee0fd10View commit details -
Configuration menu - View commit details
-
Copy full SHA for 10a74ac - Browse repository at this point
Copy the full SHA 10a74acView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ee723e - Browse repository at this point
Copy the full SHA 0ee723eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ff13ad7 - Browse repository at this point
Copy the full SHA ff13ad7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 83ce1aa - Browse repository at this point
Copy the full SHA 83ce1aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9cc7bd7 - Browse repository at this point
Copy the full SHA 9cc7bd7View commit details -
Configuration menu - View commit details
-
Copy full SHA for d33fa13 - Browse repository at this point
Copy the full SHA d33fa13View commit details -
Configuration menu - View commit details
-
Copy full SHA for da5b0cc - Browse repository at this point
Copy the full SHA da5b0ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 40f161a - Browse repository at this point
Copy the full SHA 40f161aView commit details -
Configuration menu - View commit details
-
Copy full SHA for d2d9eb3 - Browse repository at this point
Copy the full SHA d2d9eb3View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for e273152 - Browse repository at this point
Copy the full SHA e273152View commit details
Commits on Dec 11, 2021
-
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.
Configuration menu - View commit details
-
Copy full SHA for 4b674fa - Browse repository at this point
Copy the full SHA 4b674faView commit details -
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``
Configuration menu - View commit details
-
Copy full SHA for 0eedc9d - Browse repository at this point
Copy the full SHA 0eedc9dView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for fefeb46 - Browse repository at this point
Copy the full SHA fefeb46View commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 646af41 - Browse repository at this point
Copy the full SHA 646af41View commit details -
Rollup merge of rust-lang#90270 - woppopo:const_borrow_trait, r=dtolnay
Make `Borrow` and `BorrowMut` impls `const` Tracking issue: rust-lang#91522
Configuration menu - View commit details
-
Copy full SHA for b3d402e - Browse repository at this point
Copy the full SHA b3d402eView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 2356936 - Browse repository at this point
Copy the full SHA 2356936View commit details