]> git.proxmox.com Git - rustc.git/blame - src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr
New upstream version 1.57.0+dfsg1
[rustc.git] / src / test / ui / closures / 2229_closure_analysis / migrations / multi_diagnostics.stderr
CommitLineData
c295e0f8
XL
1error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
2 --> $DIR/multi_diagnostics.rs:37:13
136023e0
XL
3 |
4LL | let c = || {
c295e0f8 5 | ^^ 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`
136023e0
XL
6...
7LL | let _f_1 = f1.0;
94222f64 8 | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
136023e0
XL
9LL |
10LL | let _f_2 = f2.1;
94222f64 11 | ---- in Rust 2018, this closure captures all of `f2`, but in Rust 2021, it will only capture `f2.1`
136023e0
XL
12...
13LL | }
94222f64 14 | - in Rust 2018, `f2` is dropped here, but in Rust 2021, only `f2.1` will be dropped here as part of the closure
136023e0
XL
15 |
16note: the lint level is defined here
17 --> $DIR/multi_diagnostics.rs:2:9
18 |
19LL | #![deny(rust_2021_incompatible_closure_captures)]
20 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
22help: add a dummy let to cause `f1`, `f2` to be fully captured
23 |
94222f64
XL
24LL ~ let c = || {
25LL + let _ = (&f1, &f2);
26 |
136023e0 27
c295e0f8
XL
28error: changes to closure capture in Rust 2021 will affect which traits the closure implements
29 --> $DIR/multi_diagnostics.rs:56:13
136023e0
XL
30 |
31LL | let c = || {
c295e0f8 32 | ^^ 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`
136023e0
XL
33...
34LL | let _f_1 = f1.0;
94222f64 35 | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
136023e0
XL
36 |
37 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
38help: add a dummy let to cause `f1` to be fully captured
39 |
94222f64
XL
40LL ~ let c = || {
41LL + let _ = &f1;
42 |
136023e0 43
c295e0f8
XL
44error: changes to closure capture in Rust 2021 will affect which traits the closure implements
45 --> $DIR/multi_diagnostics.rs:81:13
136023e0
XL
46 |
47LL | let c = || {
48 | ^^
49 | |
c295e0f8
XL
50 | 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`
51 | 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`
136023e0
XL
52...
53LL | let _f_0 = f1.0;
94222f64 54 | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
136023e0
XL
55LL |
56LL | let _f_2 = f1.2;
94222f64 57 | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.2`
136023e0
XL
58 |
59 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
60help: add a dummy let to cause `f1` to be fully captured
61 |
94222f64
XL
62LL ~ let c = || {
63LL + let _ = &f1;
64 |
136023e0 65
c295e0f8
XL
66error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
67 --> $DIR/multi_diagnostics.rs:100:13
136023e0
XL
68 |
69LL | let c = || {
c295e0f8 70 | ^^ 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`
136023e0
XL
71...
72LL | let _f_0 = f1.0;
94222f64 73 | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
136023e0
XL
74LL |
75LL | let _f_1 = f1.1;
94222f64 76 | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.1`
136023e0
XL
77...
78LL | }
79 | -
80 | |
94222f64
XL
81 | in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.0` will be dropped here as part of the closure
82 | in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.1` will be dropped here as part of the closure
136023e0
XL
83 |
84 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
85help: add a dummy let to cause `f1` to be fully captured
86 |
94222f64
XL
87LL ~ let c = || {
88LL + let _ = &f1;
89 |
136023e0 90
c295e0f8
XL
91error: changes to closure capture in Rust 2021 will affect which traits the closure implements
92 --> $DIR/multi_diagnostics.rs:133:19
136023e0
XL
93 |
94LL | thread::spawn(move || unsafe {
95 | ^^^^^^^^^^^^^^
96 | |
c295e0f8
XL
97 | 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`
98 | 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`
99 | 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`
136023e0
XL
100...
101LL | *fptr1.0.0 = 20;
94222f64 102 | ---------- in Rust 2018, this closure captures all of `fptr1`, but in Rust 2021, it will only capture `fptr1.0.0`
136023e0
XL
103LL |
104LL | *fptr2.0 = 20;
94222f64 105 | -------- in Rust 2018, this closure captures all of `fptr2`, but in Rust 2021, it will only capture `fptr2.0`
136023e0
XL
106 |
107 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
108help: add a dummy let to cause `fptr1`, `fptr2` to be fully captured
109 |
94222f64 110LL ~ thread::spawn(move || { let _ = (&fptr1, &fptr2); unsafe {
136023e0
XL
111LL |
112LL |
113LL |
114LL |
115LL |
116 ...
117
118error: aborting due to 5 previous errors
119