]>
Commit | Line | Data |
---|---|---|
c295e0f8 XL |
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 | |
136023e0 XL |
3 | | |
4 | LL | let c = || { | |
c295e0f8 | 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` |
136023e0 XL |
6 | ... |
7 | LL | let _f_1 = f1.0; | |
94222f64 | 8 | | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` |
136023e0 XL |
9 | LL | |
10 | LL | let _f_2 = f2.1; | |
94222f64 | 11 | | ---- in Rust 2018, this closure captures all of `f2`, but in Rust 2021, it will only capture `f2.1` |
136023e0 XL |
12 | ... |
13 | LL | } | |
94222f64 | 14 | | - in Rust 2018, `f2` is dropped here, but in Rust 2021, only `f2.1` will be dropped here as part of the closure |
136023e0 XL |
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 | | | |
94222f64 XL |
24 | LL ~ let c = || { |
25 | LL + let _ = (&f1, &f2); | |
26 | | | |
136023e0 | 27 | |
c295e0f8 XL |
28 | error: changes to closure capture in Rust 2021 will affect which traits the closure implements |
29 | --> $DIR/multi_diagnostics.rs:56:13 | |
136023e0 XL |
30 | | |
31 | LL | let c = || { | |
c295e0f8 | 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` |
136023e0 XL |
33 | ... |
34 | LL | let _f_1 = f1.0; | |
94222f64 | 35 | | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` |
136023e0 XL |
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 | | | |
94222f64 XL |
40 | LL ~ let c = || { |
41 | LL + let _ = &f1; | |
42 | | | |
136023e0 | 43 | |
c295e0f8 XL |
44 | error: changes to closure capture in Rust 2021 will affect which traits the closure implements |
45 | --> $DIR/multi_diagnostics.rs:81:13 | |
136023e0 XL |
46 | | |
47 | LL | let c = || { | |
48 | | ^^ | |
49 | | | | |
c295e0f8 XL |
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` | |
136023e0 XL |
52 | ... |
53 | LL | let _f_0 = f1.0; | |
94222f64 | 54 | | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` |
136023e0 XL |
55 | LL | |
56 | LL | let _f_2 = f1.2; | |
94222f64 | 57 | | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.2` |
136023e0 XL |
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 | | | |
94222f64 XL |
62 | LL ~ let c = || { |
63 | LL + let _ = &f1; | |
64 | | | |
136023e0 | 65 | |
c295e0f8 XL |
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 | |
136023e0 XL |
68 | | |
69 | LL | let c = || { | |
c295e0f8 | 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` |
136023e0 XL |
71 | ... |
72 | LL | let _f_0 = f1.0; | |
94222f64 | 73 | | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` |
136023e0 XL |
74 | LL | |
75 | LL | let _f_1 = f1.1; | |
94222f64 | 76 | | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.1` |
136023e0 XL |
77 | ... |
78 | LL | } | |
79 | | - | |
80 | | | | |
94222f64 XL |
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 | |
136023e0 XL |
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 | | | |
94222f64 XL |
87 | LL ~ let c = || { |
88 | LL + let _ = &f1; | |
89 | | | |
136023e0 | 90 | |
c295e0f8 XL |
91 | error: changes to closure capture in Rust 2021 will affect which traits the closure implements |
92 | --> $DIR/multi_diagnostics.rs:133:19 | |
136023e0 XL |
93 | | |
94 | LL | thread::spawn(move || unsafe { | |
95 | | ^^^^^^^^^^^^^^ | |
96 | | | | |
c295e0f8 XL |
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` | |
136023e0 XL |
100 | ... |
101 | LL | *fptr1.0.0 = 20; | |
94222f64 | 102 | | ---------- in Rust 2018, this closure captures all of `fptr1`, but in Rust 2021, it will only capture `fptr1.0.0` |
136023e0 XL |
103 | LL | |
104 | LL | *fptr2.0 = 20; | |
94222f64 | 105 | | -------- in Rust 2018, this closure captures all of `fptr2`, but in Rust 2021, it will only capture `fptr2.0` |
136023e0 XL |
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 | | | |
94222f64 | 110 | LL ~ thread::spawn(move || { let _ = (&fptr1, &fptr2); unsafe { |
136023e0 XL |
111 | LL | |
112 | LL | | |
113 | LL | | |
114 | LL | | |
115 | LL | | |
116 | ... | |
117 | ||
118 | error: aborting due to 5 previous errors | |
119 |