1 error: changes to closure capture in Rust 2021 will affect `Send` trait implementation for closure
2 --> $DIR/auto_traits.rs:14:19
4 LL | thread::spawn(move || unsafe {
5 | ^^^^^^^^^^^^^^ in Rust 2018, this closure would implement `Send` as `fptr` implements `Send`, but in Rust 2021, this closure would no longer implement `Send` as `fptr.0` does not implement `Send`
8 | ------- in Rust 2018, closure captures all of `fptr`, but in Rust 2021, it only captures `fptr.0`
10 note: the lint level is defined here
11 --> $DIR/auto_traits.rs:2:9
13 LL | #![deny(rust_2021_incompatible_closure_captures)]
14 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
16 help: add a dummy let to cause `fptr` to be fully captured
18 LL | thread::spawn(move || { let _ = &fptr; unsafe {
26 error: changes to closure capture in Rust 2021 will affect `Sync`, `Send` trait implementation for closure
27 --> $DIR/auto_traits.rs:34:19
29 LL | thread::spawn(move || unsafe {
30 | ^^^^^^^^^^^^^^ in Rust 2018, this closure would implement `Sync`, `Send` as `fptr` implements `Sync`, `Send`, but in Rust 2021, this closure would no longer implement `Sync`, `Send` as `fptr.0.0` does not implement `Sync`, `Send`
33 | --------- in Rust 2018, closure captures all of `fptr`, but in Rust 2021, it only captures `fptr.0.0`
35 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
36 help: add a dummy let to cause `fptr` to be fully captured
38 LL | thread::spawn(move || { let _ = &fptr; unsafe {
46 error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure and drop order
47 --> $DIR/auto_traits.rs:58:13
50 | ^^ in Rust 2018, this closure would implement `Clone` as `f` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f.1` does not implement `Clone`
53 | --- in Rust 2018, closure captures all of `f`, but in Rust 2021, it only captures `f.1`
56 | - in Rust 2018, `f` would be dropped here, but in Rust 2021, only `f.1` would be dropped here alongside the closure
58 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
59 help: add a dummy let to cause `f` to be fully captured
61 LL | let c = || { let _ = &f;
69 error: aborting due to 3 previous errors