]> git.proxmox.com Git - rustc.git/blob - src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / closures / 2229_closure_analysis / migrations / migrations_rustfix.stderr
1 error: changes to closure capture in Rust 2021 will affect drop order
2 --> $DIR/migrations_rustfix.rs:19:13
3 |
4 LL | let c = || {
5 | ^^
6 ...
7 LL | let _t = t.0;
8 | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
9 ...
10 LL | }
11 | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
12 |
13 note: the lint level is defined here
14 --> $DIR/migrations_rustfix.rs:2:9
15 |
16 LL | #![deny(rust_2021_incompatible_closure_captures)]
17 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
19 help: add a dummy let to cause `t` to be fully captured
20 |
21 LL | let c = || { let _ = &t;
22 LL |
23 LL |
24 LL |
25 LL | let _t = t.0;
26 LL |
27 ...
28
29 error: changes to closure capture in Rust 2021 will affect drop order
30 --> $DIR/migrations_rustfix.rs:33:13
31 |
32 LL | let c = || t.0;
33 | ^^^---
34 | |
35 | in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
36 ...
37 LL | }
38 | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
39 |
40 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
41 help: add a dummy let to cause `t` to be fully captured
42 |
43 LL | let c = || { let _ = &t; t.0 };
44 | ^^^^^^^^^^^^^^^^^^^
45
46 error: aborting due to 2 previous errors
47