-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c98988
commit d2cbe21
Showing
3 changed files
with
61 additions
and
27 deletions.
There are no files selected for viewing
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
52 changes: 39 additions & 13 deletions
52
...st/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,45 @@ | ||
error[E0107]: missing generics for struct `Mutex` | ||
--> $DIR/insignificant_drop_attr_migrations.rs:12:8 | ||
error: changes to closure capture in Rust 2021 will affect drop order | ||
--> $DIR/insignificant_drop_attr_migrations.rs:50:13 | ||
| | ||
LL | y: Mutex, | ||
| ^^^^^ expected 1 generic argument | ||
LL | let c = || { | ||
| ^^ | ||
... | ||
LL | let _t = t.0; | ||
| --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` | ||
... | ||
LL | } | ||
| - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure | ||
| | ||
note: struct defined here, with 1 generic parameter: `T` | ||
--> $SRC_DIR/std/src/sync/mutex.rs:LL:COL | ||
note: the lint level is defined here | ||
--> $DIR/insignificant_drop_attr_migrations.rs:3:9 | ||
| | ||
LL | pub struct Mutex<T: ?Sized> { | ||
| ^^^^^ - | ||
help: add missing generic argument | ||
LL | #![deny(rust_2021_incompatible_closure_captures)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> | ||
help: add a dummy let to cause `t` to be fully captured | ||
| | ||
LL ~ let c = || { | ||
LL + let _ = &t; | ||
| | ||
|
||
error: changes to closure capture in Rust 2021 will affect drop order | ||
--> $DIR/insignificant_drop_attr_migrations.rs:70:13 | ||
| | ||
LL | let c = move || { | ||
| ^^^^^^^ | ||
... | ||
LL | let _t = t.1; | ||
| --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1` | ||
... | ||
LL | } | ||
| - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure | ||
| | ||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> | ||
help: add a dummy let to cause `t` to be fully captured | ||
| | ||
LL ~ let c = move || { | ||
LL + let _ = &t; | ||
| | ||
LL | y: Mutex<T>, | ||
| ~~~~~~~~ | ||
|
||
error: aborting due to previous error | ||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0107`. |