]>
Commit | Line | Data |
---|---|---|
136023e0 XL |
1 | error: changes to closure capture in Rust 2021 will affect drop order |
2 | --> $DIR/insignificant_drop_attr_migrations.rs:37:13 | |
17df50a5 | 3 | | |
136023e0 XL |
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 | |
17df50a5 XL |
12 | | |
13 | note: the lint level is defined here | |
14 | --> $DIR/insignificant_drop_attr_migrations.rs:3:9 | |
15 | | | |
136023e0 XL |
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> | |
17df50a5 XL |
19 | help: add a dummy let to cause `t` to be fully captured |
20 | | | |
21 | LL | let c = || { let _ = &t; | |
22 | LL | | |
23 | LL | | |
136023e0 | 24 | LL | |
17df50a5 | 25 | LL | let _t = t.0; |
136023e0 XL |
26 | LL | |
27 | ... | |
17df50a5 | 28 | |
136023e0 XL |
29 | error: changes to closure capture in Rust 2021 will affect drop order |
30 | --> $DIR/insignificant_drop_attr_migrations.rs:57:13 | |
17df50a5 | 31 | | |
136023e0 XL |
32 | LL | let c = move || { |
33 | | ^^^^^^^ | |
34 | ... | |
35 | LL | let _t = t.1; | |
36 | | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.1` | |
37 | ... | |
38 | LL | } | |
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 |
42 | help: add a dummy let to cause `t` to be fully captured |
43 | | | |
44 | LL | let c = move || { let _ = &t; | |
45 | LL | | |
46 | LL | | |
136023e0 | 47 | LL | |
17df50a5 | 48 | LL | let _t = t.1; |
136023e0 XL |
49 | LL | |
50 | ... | |
17df50a5 XL |
51 | |
52 | error: aborting due to 2 previous errors | |
53 |