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