]> git.proxmox.com Git - rustc.git/blob - src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr
New upstream version 1.57.0+dfsg1
[rustc.git] / src / test / ui / closures / 2229_closure_analysis / migrations / multi_diagnostics.stderr
1 error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
2 --> $DIR/multi_diagnostics.rs:37:13
3 |
4 LL | let c = || {
5 | ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone`
6 ...
7 LL | let _f_1 = f1.0;
8 | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
9 LL |
10 LL | let _f_2 = f2.1;
11 | ---- in Rust 2018, this closure captures all of `f2`, but in Rust 2021, it will only capture `f2.1`
12 ...
13 LL | }
14 | - in Rust 2018, `f2` is dropped here, but in Rust 2021, only `f2.1` will be dropped here as part of the closure
15 |
16 note: the lint level is defined here
17 --> $DIR/multi_diagnostics.rs:2:9
18 |
19 LL | #![deny(rust_2021_incompatible_closure_captures)]
20 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
22 help: add a dummy let to cause `f1`, `f2` to be fully captured
23 |
24 LL ~ let c = || {
25 LL + let _ = (&f1, &f2);
26 |
27
28 error: changes to closure capture in Rust 2021 will affect which traits the closure implements
29 --> $DIR/multi_diagnostics.rs:56:13
30 |
31 LL | let c = || {
32 | ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone`
33 ...
34 LL | let _f_1 = f1.0;
35 | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
36 |
37 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
38 help: add a dummy let to cause `f1` to be fully captured
39 |
40 LL ~ let c = || {
41 LL + let _ = &f1;
42 |
43
44 error: changes to closure capture in Rust 2021 will affect which traits the closure implements
45 --> $DIR/multi_diagnostics.rs:81:13
46 |
47 LL | let c = || {
48 | ^^
49 | |
50 | in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone`
51 | in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.2` does not implement `Clone`
52 ...
53 LL | let _f_0 = f1.0;
54 | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
55 LL |
56 LL | let _f_2 = f1.2;
57 | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.2`
58 |
59 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
60 help: add a dummy let to cause `f1` to be fully captured
61 |
62 LL ~ let c = || {
63 LL + let _ = &f1;
64 |
65
66 error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
67 --> $DIR/multi_diagnostics.rs:100:13
68 |
69 LL | let c = || {
70 | ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone`
71 ...
72 LL | let _f_0 = f1.0;
73 | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
74 LL |
75 LL | let _f_1 = f1.1;
76 | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.1`
77 ...
78 LL | }
79 | -
80 | |
81 | in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.0` will be dropped here as part of the closure
82 | in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.1` will be dropped here as part of the closure
83 |
84 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
85 help: add a dummy let to cause `f1` to be fully captured
86 |
87 LL ~ let c = || {
88 LL + let _ = &f1;
89 |
90
91 error: changes to closure capture in Rust 2021 will affect which traits the closure implements
92 --> $DIR/multi_diagnostics.rs:133:19
93 |
94 LL | thread::spawn(move || unsafe {
95 | ^^^^^^^^^^^^^^
96 | |
97 | in Rust 2018, this closure implements `Sync` as `fptr1` implements `Sync`, but in Rust 2021, this closure will no longer implement `Sync` because `fptr1` is not fully captured and `fptr1.0.0` does not implement `Sync`
98 | in Rust 2018, this closure implements `Send` as `fptr1` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr1` is not fully captured and `fptr1.0.0` does not implement `Send`
99 | in Rust 2018, this closure implements `Send` as `fptr2` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr2` is not fully captured and `fptr2.0` does not implement `Send`
100 ...
101 LL | *fptr1.0.0 = 20;
102 | ---------- in Rust 2018, this closure captures all of `fptr1`, but in Rust 2021, it will only capture `fptr1.0.0`
103 LL |
104 LL | *fptr2.0 = 20;
105 | -------- in Rust 2018, this closure captures all of `fptr2`, but in Rust 2021, it will only capture `fptr2.0`
106 |
107 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
108 help: add a dummy let to cause `fptr1`, `fptr2` to be fully captured
109 |
110 LL ~ thread::spawn(move || { let _ = (&fptr1, &fptr2); unsafe {
111 LL |
112 LL |
113 LL |
114 LL |
115 LL |
116 ...
117
118 error: aborting due to 5 previous errors
119