]> git.proxmox.com Git - rustc.git/blob - src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / closures / 2229_closure_analysis / migrations / auto_traits.stderr
1 error: changes to closure capture in Rust 2021 will affect `Send` trait implementation for closure
2 --> $DIR/auto_traits.rs:14:19
3 |
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`
6 ...
7 LL | *fptr.0 = 20;
8 | ------- in Rust 2018, closure captures all of `fptr`, but in Rust 2021, it only captures `fptr.0`
9 |
10 note: the lint level is defined here
11 --> $DIR/auto_traits.rs:2:9
12 |
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
17 |
18 LL | thread::spawn(move || { let _ = &fptr; unsafe {
19 LL |
20 LL |
21 LL |
22 LL |
23 LL | *fptr.0 = 20;
24 ...
25
26 error: changes to closure capture in Rust 2021 will affect `Sync`, `Send` trait implementation for closure
27 --> $DIR/auto_traits.rs:34:19
28 |
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`
31 ...
32 LL | *fptr.0.0 = 20;
33 | --------- in Rust 2018, closure captures all of `fptr`, but in Rust 2021, it only captures `fptr.0.0`
34 |
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
37 |
38 LL | thread::spawn(move || { let _ = &fptr; unsafe {
39 LL |
40 LL |
41 LL |
42 LL |
43 LL | *fptr.0.0 = 20;
44 ...
45
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
48 |
49 LL | let c = || {
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`
51 ...
52 LL | let f_1 = f.1;
53 | --- in Rust 2018, closure captures all of `f`, but in Rust 2021, it only captures `f.1`
54 ...
55 LL | }
56 | - in Rust 2018, `f` would be dropped here, but in Rust 2021, only `f.1` would be dropped here alongside the closure
57 |
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
60 |
61 LL | let c = || { let _ = &f;
62 LL |
63 LL |
64 LL |
65 LL |
66 LL | let f_1 = f.1;
67 ...
68
69 error: aborting due to 3 previous errors
70