]>
Commit | Line | Data |
---|---|---|
136023e0 XL |
1 | error: changes to closure capture in Rust 2021 will affect drop order |
2 | --> $DIR/precise.rs:20:13 | |
6a06907d | 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 | |
6a06907d XL |
12 | | |
13 | note: the lint level is defined here | |
cdc7bbd5 | 14 | --> $DIR/precise.rs:3:9 |
6a06907d | 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> | |
cdc7bbd5 | 19 | help: add a dummy let to cause `t` to be fully captured |
6a06907d | 20 | | |
cdc7bbd5 XL |
21 | LL | let c = || { let _ = &t; |
22 | LL | | |
23 | LL | | |
136023e0 | 24 | LL | |
cdc7bbd5 | 25 | LL | let _t = t.0; |
136023e0 XL |
26 | LL | |
27 | ... | |
6a06907d | 28 | |
136023e0 XL |
29 | error: changes to closure capture in Rust 2021 will affect drop order |
30 | --> $DIR/precise.rs:45:13 | |
6a06907d | 31 | | |
136023e0 XL |
32 | LL | let c = || { |
33 | | ^^ | |
34 | ... | |
35 | LL | let _x = u.0.0; | |
36 | | ----- in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.0.0` | |
37 | LL | | |
38 | LL | let _x = u.0.1; | |
39 | | ----- in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.0.1` | |
40 | LL | | |
41 | LL | 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 | ... | |
44 | LL | } | |
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 |
52 | help: add a dummy let to cause `u` to be fully captured |
53 | | | |
54 | LL | let c = || { let _ = &u; | |
55 | LL | | |
56 | LL | | |
136023e0 | 57 | LL | |
cdc7bbd5 | 58 | LL | let _x = u.0.0; |
136023e0 | 59 | LL | |
cdc7bbd5 | 60 | ... |
6a06907d | 61 | |
cdc7bbd5 | 62 | error: aborting due to 2 previous errors |
6a06907d | 63 |