rust/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

119 lines
6.1 KiB
Plaintext
Raw Normal View History

error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
--> $DIR/multi_diagnostics.rs:37:13
2021-07-08 16:04:58 -05:00
|
LL | let c = || {
2021-11-05 11:43:42 -05:00
| ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone`
2021-07-08 16:04:58 -05:00
...
LL | let _f_1 = f1.0;
| ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
2021-07-08 16:04:58 -05:00
LL |
LL | let _f_2 = f2.1;
| ---- in Rust 2018, this closure captures all of `f2`, but in Rust 2021, it will only capture `f2.1`
2021-07-08 16:04:58 -05:00
...
LL | }
| - in Rust 2018, `f2` is dropped here, but in Rust 2021, only `f2.1` will be dropped here as part of the closure
2021-07-08 16:04:58 -05:00
|
2022-09-18 10:55:36 -05:00
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
2021-07-08 16:04:58 -05:00
note: the lint level is defined here
--> $DIR/multi_diagnostics.rs:2:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: add a dummy let to cause `f1`, `f2` to be fully captured
|
2021-08-12 04:23:48 -05:00
LL ~ let c = || {
LL + let _ = (&f1, &f2);
2021-08-12 05:17:35 -05:00
|
2021-07-08 16:04:58 -05:00
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
--> $DIR/multi_diagnostics.rs:56:13
2021-07-08 16:04:58 -05:00
|
LL | let c = || {
2021-11-05 11:43:42 -05:00
| ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone`
2021-07-08 16:04:58 -05:00
...
LL | let _f_1 = f1.0;
| ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
2021-07-08 16:04:58 -05:00
|
= 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 `f1` to be fully captured
|
2021-08-12 04:23:48 -05:00
LL ~ let c = || {
LL + let _ = &f1;
2021-08-12 05:17:35 -05:00
|
2021-07-08 16:04:58 -05:00
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
--> $DIR/multi_diagnostics.rs:81:13
2021-07-08 16:04:58 -05:00
|
LL | let c = || {
| ^^
| |
2021-11-05 11:43:42 -05:00
| in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone`
| in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.2` does not implement `Clone`
2021-07-08 16:04:58 -05:00
...
LL | let _f_0 = f1.0;
| ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
2021-07-08 16:04:58 -05:00
LL |
LL | let _f_2 = f1.2;
| ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.2`
2021-07-08 16:04:58 -05:00
|
= 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 `f1` to be fully captured
|
2021-08-12 04:23:48 -05:00
LL ~ let c = || {
LL + let _ = &f1;
2021-08-12 05:17:35 -05:00
|
2021-07-08 16:04:58 -05:00
error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
--> $DIR/multi_diagnostics.rs:100:13
2021-07-08 16:04:58 -05:00
|
LL | let c = || {
2021-11-05 11:43:42 -05:00
| ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone`
2021-07-08 16:04:58 -05:00
...
LL | let _f_0 = f1.0;
| ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
2021-07-08 16:04:58 -05:00
LL |
LL | let _f_1 = f1.1;
| ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.1`
2021-07-08 16:04:58 -05:00
...
LL | }
| -
| |
| in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.0` will be dropped here as part of the closure
| in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.1` will be dropped here as part of the closure
2021-07-08 16:04:58 -05:00
|
= 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 `f1` to be fully captured
|
2021-08-12 04:23:48 -05:00
LL ~ let c = || {
LL + let _ = &f1;
2021-08-12 05:17:35 -05:00
|
2021-07-08 16:04:58 -05:00
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
--> $DIR/multi_diagnostics.rs:133:19
2021-07-08 16:04:58 -05:00
|
LL | thread::spawn(move || unsafe {
2022-06-27 00:45:35 -05:00
| ^^^^^^^
2021-07-08 16:04:58 -05:00
| |
2021-11-05 11:43:42 -05:00
| in Rust 2018, this closure implements `Send` as `fptr1` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr1` is not fully captured and `fptr1.0.0` does not implement `Send`
| in Rust 2018, this closure implements `Sync` as `fptr1` implements `Sync`, but in Rust 2021, this closure will no longer implement `Sync` because `fptr1` is not fully captured and `fptr1.0.0` does not implement `Sync`
2021-11-05 11:43:42 -05:00
| in Rust 2018, this closure implements `Send` as `fptr2` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr2` is not fully captured and `fptr2.0` does not implement `Send`
2021-07-08 16:04:58 -05:00
...
LL | *fptr1.0.0 = 20;
| ---------- in Rust 2018, this closure captures all of `fptr1`, but in Rust 2021, it will only capture `fptr1.0.0`
2021-07-08 16:04:58 -05:00
LL |
LL | *fptr2.0 = 20;
| -------- in Rust 2018, this closure captures all of `fptr2`, but in Rust 2021, it will only capture `fptr2.0`
2021-07-08 16:04:58 -05:00
|
= 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 `fptr1`, `fptr2` to be fully captured
|
LL ~ thread::spawn(move || { let _ = (&fptr1, &fptr2); unsafe {
2021-08-12 05:17:35 -05:00
LL |
2021-07-08 16:04:58 -05:00
...
2022-06-06 10:26:50 -05:00
LL |
2023-02-12 13:37:09 -06:00
LL ~ } }).join().unwrap();
2022-06-06 10:26:50 -05:00
|
2021-07-08 16:04:58 -05:00
error: aborting due to 5 previous errors