]> git.proxmox.com Git - rustc.git/blame - src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / closures / 2229_closure_analysis / migrations / precise.stderr
CommitLineData
136023e0
XL
1error: changes to closure capture in Rust 2021 will affect drop order
2 --> $DIR/precise.rs:20:13
6a06907d 3 |
136023e0
XL
4LL | let c = || {
5 | ^^
6...
7LL | let _t = t.0;
8 | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
9...
10LL | }
11 | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
6a06907d
XL
12 |
13note: the lint level is defined here
cdc7bbd5 14 --> $DIR/precise.rs:3:9
6a06907d 15 |
136023e0
XL
16LL | #![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>
cdc7bbd5 19help: add a dummy let to cause `t` to be fully captured
6a06907d 20 |
cdc7bbd5
XL
21LL | let c = || { let _ = &t;
22LL |
23LL |
136023e0 24LL |
cdc7bbd5 25LL | let _t = t.0;
136023e0
XL
26LL |
27 ...
6a06907d 28
136023e0
XL
29error: changes to closure capture in Rust 2021 will affect drop order
30 --> $DIR/precise.rs:45:13
6a06907d 31 |
136023e0
XL
32LL | let c = || {
33 | ^^
34...
35LL | let _x = u.0.0;
36 | ----- in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.0.0`
37LL |
38LL | let _x = u.0.1;
39 | ----- in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.0.1`
40LL |
41LL | let _x = u.1.0;
42 | ----- in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.1.0`
43...
44LL | }
45 | -
46 | |
47 | in Rust 2018, `u` would be dropped here, but in Rust 2021, only `u.0.0` would be dropped here alongside the closure
48 | in Rust 2018, `u` would be dropped here, but in Rust 2021, only `u.0.1` would be dropped here alongside the closure
49 | in Rust 2018, `u` would be dropped here, but in Rust 2021, only `u.1.0` would be dropped here alongside the closure
50 |
51 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
cdc7bbd5
XL
52help: add a dummy let to cause `u` to be fully captured
53 |
54LL | let c = || { let _ = &u;
55LL |
56LL |
136023e0 57LL |
cdc7bbd5 58LL | let _x = u.0.0;
136023e0 59LL |
cdc7bbd5 60 ...
6a06907d 61
cdc7bbd5 62error: aborting due to 2 previous errors
6a06907d 63