]> git.proxmox.com Git - rustc.git/blame - src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / closures / 2229_closure_analysis / migrations / significant_drop.stderr
CommitLineData
136023e0 1error: changes to closure capture in Rust 2021 will affect drop order
cdc7bbd5 2 --> $DIR/significant_drop.rs:25:13
5869c6ff 3 |
136023e0
XL
4LL | let c = || {
5 | ^^
6...
7LL | let _t = t.0;
94222f64 8 | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
136023e0
XL
9LL |
10LL | let _t1 = t1.0;
94222f64 11 | ---- in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0`
136023e0
XL
12LL |
13LL | let _t2 = t2.0;
94222f64 14 | ---- in Rust 2018, this closure captures all of `t2`, but in Rust 2021, it will only capture `t2.0`
136023e0
XL
15...
16LL | }
17 | -
18 | |
94222f64
XL
19 | in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
20 | in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure
21 | in Rust 2018, `t2` is dropped here, but in Rust 2021, only `t2.0` will be dropped here as part of the closure
5869c6ff 22 |
2b03887a 23 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
5869c6ff 24note: the lint level is defined here
cdc7bbd5 25 --> $DIR/significant_drop.rs:2:9
5869c6ff 26 |
136023e0
XL
27LL | #![deny(rust_2021_incompatible_closure_captures)]
28 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cdc7bbd5
XL
29help: add a dummy let to cause `t`, `t1`, `t2` to be fully captured
30 |
94222f64
XL
31LL ~ let c = || {
32LL + let _ = (&t, &t1, &t2);
33 |
5869c6ff 34
136023e0
XL
35error: changes to closure capture in Rust 2021 will affect drop order
36 --> $DIR/significant_drop.rs:50:13
5869c6ff 37 |
136023e0
XL
38LL | let c = || {
39 | ^^
40...
41LL | let _t = t.0;
94222f64 42 | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
136023e0
XL
43LL |
44LL | let _t1 = t1.0;
94222f64 45 | ---- in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0`
136023e0
XL
46...
47LL | }
48 | -
49 | |
94222f64
XL
50 | in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
51 | in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure
136023e0
XL
52 |
53 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
cdc7bbd5
XL
54help: add a dummy let to cause `t`, `t1` to be fully captured
55 |
94222f64
XL
56LL ~ let c = || {
57LL + let _ = (&t, &t1);
58 |
5869c6ff 59
136023e0
XL
60error: changes to closure capture in Rust 2021 will affect drop order
61 --> $DIR/significant_drop.rs:71:13
5869c6ff 62 |
136023e0
XL
63LL | let c = || {
64 | ^^
65...
66LL | let _t = t.0;
94222f64 67 | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
136023e0
XL
68...
69LL | }
94222f64 70 | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
136023e0
XL
71 |
72 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
cdc7bbd5
XL
73help: add a dummy let to cause `t` to be fully captured
74 |
94222f64
XL
75LL ~ let c = || {
76LL + let _ = &t;
77 |
5869c6ff 78
136023e0
XL
79error: changes to closure capture in Rust 2021 will affect drop order
80 --> $DIR/significant_drop.rs:91:13
5869c6ff 81 |
136023e0
XL
82LL | let c = || {
83 | ^^
84...
85LL | let _t = t.0;
94222f64 86 | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
136023e0
XL
87...
88LL | }
94222f64 89 | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
5869c6ff 90 |
136023e0 91 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
cdc7bbd5
XL
92help: add a dummy let to cause `t` to be fully captured
93 |
94222f64
XL
94LL ~ let c = || {
95LL + let _ = &t;
96 |
5869c6ff 97
136023e0
XL
98error: changes to closure capture in Rust 2021 will affect drop order
99 --> $DIR/significant_drop.rs:109:13
5869c6ff 100 |
136023e0
XL
101LL | let c = || {
102 | ^^
103...
104LL | let _t = t.0;
94222f64 105 | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
136023e0
XL
106...
107LL | }
94222f64 108 | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
5869c6ff 109 |
136023e0 110 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
cdc7bbd5
XL
111help: add a dummy let to cause `t` to be fully captured
112 |
94222f64
XL
113LL ~ let c = || {
114LL + let _ = &t;
115 |
5869c6ff 116
136023e0
XL
117error: changes to closure capture in Rust 2021 will affect drop order
118 --> $DIR/significant_drop.rs:125:13
5869c6ff 119 |
136023e0
XL
120LL | let c = || {
121 | ^^
122...
123LL | let _t = t.1;
94222f64 124 | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1`
136023e0
XL
125...
126LL | }
94222f64 127 | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure
5869c6ff 128 |
136023e0 129 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
cdc7bbd5
XL
130help: add a dummy let to cause `t` to be fully captured
131 |
94222f64
XL
132LL ~ let c = || {
133LL + let _ = &t;
134 |
5869c6ff 135
136023e0
XL
136error: changes to closure capture in Rust 2021 will affect drop order
137 --> $DIR/significant_drop.rs:143:13
5869c6ff 138 |
136023e0
XL
139LL | let c = move || {
140 | ^^^^^^^
141...
142LL | println!("{:?} {:?}", t1.1, t.1);
94222f64 143 | ---- --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1`
136023e0 144 | |
94222f64 145 | in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.1`
136023e0
XL
146...
147LL | }
148 | -
149 | |
94222f64
XL
150 | in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.1` will be dropped here as part of the closure
151 | in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure
136023e0
XL
152 |
153 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
cdc7bbd5
XL
154help: add a dummy let to cause `t1`, `t` to be fully captured
155 |
94222f64
XL
156LL ~ let c = move || {
157LL + let _ = (&t1, &t);
158 |
136023e0
XL
159
160error: changes to closure capture in Rust 2021 will affect drop order
161 --> $DIR/significant_drop.rs:163:21
162 |
163LL | let c = || {
164 | ^^
165...
166LL | tuple.0;
94222f64 167 | ------- in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0`
136023e0
XL
168...
169LL | }
94222f64 170 | - in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure
136023e0
XL
171 |
172 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
173help: add a dummy let to cause `tuple` to be fully captured
174 |
94222f64
XL
175LL ~ let c = || {
176LL + let _ = &tuple;
177 |
136023e0
XL
178
179error: changes to closure capture in Rust 2021 will affect drop order
180 --> $DIR/significant_drop.rs:181:17
181 |
182LL | let c = || {
183 | ^^
184...
185LL | tuple.0;
94222f64 186 | ------- in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0`
136023e0 187...
cdc7bbd5 188LL | };
94222f64 189 | - in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure
136023e0
XL
190 |
191 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
192help: add a dummy let to cause `tuple` to be fully captured
cdc7bbd5 193 |
94222f64
XL
194LL ~ let c = || {
195LL + let _ = &tuple;
196 |
197
198error: changes to closure capture in Rust 2021 will affect drop order
199 --> $DIR/significant_drop.rs:201:18
200 |
201LL | let _c = || tup.0;
064997fb 202 | ^^ ----- in Rust 2018, this closure captures all of `tup`, but in Rust 2021, it will only capture `tup.0`
94222f64
XL
203...
204LL | }
205 | - in Rust 2018, `tup` is dropped here, but in Rust 2021, only `tup.0` will be dropped here as part of the closure
206 |
207 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
208help: add a dummy let to cause `tup` to be fully captured
209 |
210LL | let _c = || { let _ = &tup; tup.0 };
211 | +++++++++++++++ +
5869c6ff 212
94222f64 213error: aborting due to 10 previous errors
5869c6ff 214