-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…is,lqd Improves migrations lint for RFC2229 This PR improves the current disjoint capture migration lint by providing more information on why drop order or auto trait implementation for a closure is impacted by the use of the new feature. The drop order migration lint will now look something like this: ``` error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/significant_drop.rs:163:21 | LL | let c = || { | ^^ ... LL | tuple.0; | ------- in Rust 2018, closure captures all of `tuple`, but in Rust 2021, it only captures `tuple.0` ... LL | } | - in Rust 2018, `tuple` would be dropped here, but in Rust 2021, only `tuple.0` would be dropped here alongside the closure ``` The auto trait migration lint will now look something like this: ``` error: changes to closure capture in Rust 2021 will affect `Send` trait implementation for closure --> $DIR/auto_traits.rs:14:19 | LL | thread::spawn(move || unsafe { | ^^^^^^^^^^^^^^ in Rust 2018, this closure would implement `Send` as `fptr` implements `Send`, but in Rust 2021, this closure would no longer implement `Send` as `fptr.0` does not implement `Send` ... LL | *fptr.0 = 20; | ------- in Rust 2018, closure captures all of `fptr`, but in Rust 2021, it only captures `fptr.0` ``` r? `@nikomatsakis` Closes rust-lang/project-rfc-2229#54
- Loading branch information
Showing
25 changed files
with
1,274 additions
and
444 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.