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