fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
884 B22 linesraw
1error: changes to closure capture in Rust 2021 will affect drop order
2  --> $DIR/macro.rs:19:13
3   |
4LL |     let _ = || dbg!(a.0);
5   |             ^^      --- in Rust 2018, this closure captures all of `a`, but in Rust 2021, it will only capture `a.0`
6...
7LL | }
8   | - in Rust 2018, `a` is dropped here, but in Rust 2021, only `a.0` will be dropped here as part of the closure
9   |
10   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
11note: the lint level is defined here
12  --> $DIR/macro.rs:5:9
13   |
14LL | #![deny(rust_2021_incompatible_closure_captures)]
15   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16help: add a dummy let to cause `a` to be fully captured
17   |
18LL |     let _ = || { let _ = &a; dbg!(a.0) };
19   |                +++++++++++++           +
20
21error: aborting due to previous error
22