You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of rust-lang#90631 - matthiaskrgr:rollup-a5tzjh3, r=matthiaskrgr
Rollup of 5 pull requests
Successful merges:
- rust-lang#89942 (Reorder `widening_impl`s to make the doc clearer)
- rust-lang#90569 (Fix tests using `only-i686` to use the correct `only-x86` directive)
- rust-lang#90597 (Warn for variables that are no longer captured)
- rust-lang#90623 (Remove more checks for LLVM < 12)
- rust-lang#90626 (Properly register text_direction_codepoint_in_comment lint.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Copy file name to clipboardexpand all lines: src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed
+7-6
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,8 @@ fn test_send_trait() {
20
20
letmut f = 10;
21
21
let fptr = SendPointer(&mut f as*muti32);
22
22
thread::spawn(move || {let _ = &fptr;unsafe{
23
-
//~^ ERROR: `Send` trait implementation for closure
24
-
//~| NOTE: in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` as `fptr.0` does not implement `Send`
23
+
//~^ ERROR: changes to closure capture
24
+
//~| NOTE: in Rust 2018, this closure implements `Send`
25
25
//~| NOTE: for more information, see
26
26
//~| HELP: add a dummy let to cause `fptr` to be fully captured
27
27
*fptr.0 = 20;
@@ -40,8 +40,9 @@ fn test_sync_trait() {
40
40
let f = CustomInt(&mut f as*muti32);
41
41
let fptr = SyncPointer(f);
42
42
thread::spawn(move || {let _ = &fptr;unsafe{
43
-
//~^ ERROR: `Sync`, `Send` trait implementation for closure
44
-
//~| NOTE: in Rust 2018, this closure implements `Sync`, `Send` as `fptr` implements `Sync`, `Send`, but in Rust 2021, this closure will no longer implement `Sync`, `Send` as `fptr.0.0` does not implement `Sync`, `Send`
43
+
//~^ ERROR: changes to closure capture
44
+
//~| NOTE: in Rust 2018, this closure implements `Sync`
45
+
//~| NOTE: in Rust 2018, this closure implements `Send`
45
46
//~| NOTE: for more information, see
46
47
//~| HELP: add a dummy let to cause `fptr` to be fully captured
47
48
*fptr.0.0 = 20;
@@ -65,8 +66,8 @@ fn test_clone_trait() {
65
66
let f = U(S(Foo(0)),T(0));
66
67
let c = || {
67
68
let _ = &f;
68
-
//~^ ERROR: `Clone` trait implementation for closure and drop order
69
-
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f.1` does not implement `Clone`
69
+
//~^ ERROR: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
70
+
//~| NOTE: in Rust 2018, this closure implements `Clone`
70
71
//~| NOTE: for more information, see
71
72
//~| HELP: add a dummy let to cause `f` to be fully captured
Copy file name to clipboardexpand all lines: src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.rs
+7-6
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,8 @@ fn test_send_trait() {
20
20
letmut f = 10;
21
21
let fptr = SendPointer(&mut f as*muti32);
22
22
thread::spawn(move || unsafe{
23
-
//~^ ERROR: `Send` trait implementation for closure
24
-
//~| NOTE: in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` as `fptr.0` does not implement `Send`
23
+
//~^ ERROR: changes to closure capture
24
+
//~| NOTE: in Rust 2018, this closure implements `Send`
25
25
//~| NOTE: for more information, see
26
26
//~| HELP: add a dummy let to cause `fptr` to be fully captured
27
27
*fptr.0 = 20;
@@ -40,8 +40,9 @@ fn test_sync_trait() {
40
40
let f = CustomInt(&mut f as*muti32);
41
41
let fptr = SyncPointer(f);
42
42
thread::spawn(move || unsafe{
43
-
//~^ ERROR: `Sync`, `Send` trait implementation for closure
44
-
//~| NOTE: in Rust 2018, this closure implements `Sync`, `Send` as `fptr` implements `Sync`, `Send`, but in Rust 2021, this closure will no longer implement `Sync`, `Send` as `fptr.0.0` does not implement `Sync`, `Send`
43
+
//~^ ERROR: changes to closure capture
44
+
//~| NOTE: in Rust 2018, this closure implements `Sync`
45
+
//~| NOTE: in Rust 2018, this closure implements `Send`
45
46
//~| NOTE: for more information, see
46
47
//~| HELP: add a dummy let to cause `fptr` to be fully captured
47
48
*fptr.0.0 = 20;
@@ -64,8 +65,8 @@ impl Clone for U {
64
65
fntest_clone_trait(){
65
66
let f = U(S(Foo(0)),T(0));
66
67
let c = || {
67
-
//~^ ERROR: `Clone` trait implementation for closure and drop order
68
-
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f.1` does not implement `Clone`
68
+
//~^ ERROR: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
69
+
//~| NOTE: in Rust 2018, this closure implements `Clone`
69
70
//~| NOTE: for more information, see
70
71
//~| HELP: add a dummy let to cause `f` to be fully captured
Copy file name to clipboardexpand all lines: src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr
+11-8
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
error: changes to closure capture in Rust 2021 will affect `Send` trait implementation for closure
1
+
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
2
2
--> $DIR/auto_traits.rs:22:19
3
3
|
4
4
LL | thread::spawn(move || unsafe {
5
-
| ^^^^^^^^^^^^^^ in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` as `fptr.0` does not implement `Send`
5
+
| ^^^^^^^^^^^^^^ in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr` is not fully captured and `fptr.0` does not implement `Send`
6
6
...
7
7
LL | *fptr.0 = 20;
8
8
| ------- in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0`
@@ -23,11 +23,14 @@ LL |
23
23
LL | *fptr.0 = 20;
24
24
...
25
25
26
-
error: changes to closure capture in Rust 2021 will affect `Sync`, `Send` trait implementation for closure
26
+
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
27
27
--> $DIR/auto_traits.rs:42:19
28
28
|
29
29
LL | thread::spawn(move || unsafe {
30
-
| ^^^^^^^^^^^^^^ in Rust 2018, this closure implements `Sync`, `Send` as `fptr` implements `Sync`, `Send`, but in Rust 2021, this closure will no longer implement `Sync`, `Send` as `fptr.0.0` does not implement `Sync`, `Send`
30
+
| ^^^^^^^^^^^^^^
31
+
| |
32
+
| in Rust 2018, this closure implements `Sync` as `fptr` implements `Sync`, but in Rust 2021, this closure will no longer implement `Sync` because `fptr` is not fully captured and `fptr.0.0` does not implement `Sync`
33
+
| in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr` is not fully captured and `fptr.0.0` does not implement `Send`
31
34
...
32
35
LL | *fptr.0.0 = 20;
33
36
| --------- in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0.0`
@@ -40,14 +43,14 @@ LL |
40
43
LL |
41
44
LL |
42
45
LL |
43
-
LL | *fptr.0.0 = 20;
46
+
LL |
44
47
...
45
48
46
-
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure and drop order
47
-
--> $DIR/auto_traits.rs:66:13
49
+
error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
50
+
--> $DIR/auto_traits.rs:67:13
48
51
|
49
52
LL | let c = || {
50
-
| ^^ in Rust 2018, this closure implements `Clone` as `f` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f.1` does not implement `Clone`
53
+
| ^^ in Rust 2018, this closure implements `Clone` as `f` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f` is not fully captured and `f.1` does not implement `Clone`
51
54
...
52
55
LL | let f_1 = f.1;
53
56
| --- in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.1`
Copy file name to clipboardexpand all lines: src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed
+3-2
Original file line number
Diff line number
Diff line change
@@ -19,8 +19,9 @@ where
19
19
let f = panic::AssertUnwindSafe(f);
20
20
let result = panic::catch_unwind(move || {
21
21
let _ = &f;
22
-
//~^ ERROR: `UnwindSafe`, `RefUnwindSafe` trait implementation for closure
23
-
//~| NOTE: in Rust 2018, this closure implements `UnwindSafe`, `RefUnwindSafe` as `f` implements `UnwindSafe`, `RefUnwindSafe`, but in Rust 2021, this closure will no longer implement `UnwindSafe`, `RefUnwindSafe` as `f.0` does not implement `UnwindSafe`, `RefUnwindSafe`
22
+
//~^ ERROR: changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures]
23
+
//~| NOTE: in Rust 2018, this closure implements `UnwindSafe`
24
+
//~| NOTE: in Rust 2018, this closure implements `RefUnwindSafe`
24
25
//~| NOTE: for more information, see
25
26
//~| HELP: add a dummy let to cause `f` to be fully captured
Copy file name to clipboardexpand all lines: src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs
+3-2
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,9 @@ where
18
18
{
19
19
let f = panic::AssertUnwindSafe(f);
20
20
let result = panic::catch_unwind(move || {
21
-
//~^ ERROR: `UnwindSafe`, `RefUnwindSafe` trait implementation for closure
22
-
//~| NOTE: in Rust 2018, this closure implements `UnwindSafe`, `RefUnwindSafe` as `f` implements `UnwindSafe`, `RefUnwindSafe`, but in Rust 2021, this closure will no longer implement `UnwindSafe`, `RefUnwindSafe` as `f.0` does not implement `UnwindSafe`, `RefUnwindSafe`
21
+
//~^ ERROR: changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures]
22
+
//~| NOTE: in Rust 2018, this closure implements `UnwindSafe`
23
+
//~| NOTE: in Rust 2018, this closure implements `RefUnwindSafe`
23
24
//~| NOTE: for more information, see
24
25
//~| HELP: add a dummy let to cause `f` to be fully captured
Copy file name to clipboardexpand all lines: src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr
+5-2
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,11 @@
1
-
error: changes to closure capture in Rust 2021 will affect `UnwindSafe`, `RefUnwindSafe` trait implementation for closure
1
+
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
2
2
--> $DIR/mir_calls_to_shims.rs:20:38
3
3
|
4
4
LL | let result = panic::catch_unwind(move || {
5
-
| ^^^^^^^ in Rust 2018, this closure implements `UnwindSafe`, `RefUnwindSafe` as `f` implements `UnwindSafe`, `RefUnwindSafe`, but in Rust 2021, this closure will no longer implement `UnwindSafe`, `RefUnwindSafe` as `f.0` does not implement `UnwindSafe`, `RefUnwindSafe`
5
+
| ^^^^^^^
6
+
| |
7
+
| in Rust 2018, this closure implements `UnwindSafe` as `f` implements `UnwindSafe`, but in Rust 2021, this closure will no longer implement `UnwindSafe` because `f` is not fully captured and `f.0` does not implement `UnwindSafe`
8
+
| in Rust 2018, this closure implements `RefUnwindSafe` as `f` implements `RefUnwindSafe`, but in Rust 2021, this closure will no longer implement `RefUnwindSafe` because `f` is not fully captured and `f.0` does not implement `RefUnwindSafe`
6
9
...
7
10
LL | f.0()
8
11
| --- in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.0`
Copy file name to clipboardexpand all lines: src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed
+13-13
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,6 @@ impl Foo {
18
18
}
19
19
}
20
20
21
-
22
21
structS(Foo);
23
22
24
23
#[derive(Clone)]
@@ -37,8 +36,8 @@ fn test_multi_issues() {
37
36
let f2 = U(S(Foo::from("bar")),T(0));
38
37
let c = || {
39
38
let _ = (&f1,&f2);
40
-
//~^ ERROR: `Clone` trait implementation for closure and drop order
41
-
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
39
+
//~^ ERROR: changes to closure capture in Rust 2021
40
+
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`
42
41
//~| NOTE: for more information, see
43
42
//~| HELP: add a dummy let to cause `f1`, `f2` to be fully captured
//~^ ERROR: `Clone` trait implementation for closure
61
-
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
59
+
//~^ ERROR: changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures]
60
+
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`
62
61
//~| NOTE: for more information, see
63
62
//~| HELP: add a dummy let to cause `f1` to be fully captured
let f1 = U1(S(Foo::from("foo")),T(0),S(Foo::from("bar")));
84
83
let c = || {
85
84
let _ = &f1;
86
-
//~^ ERROR: `Clone` trait implementation for closure
87
-
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
88
-
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.2` does not implement `Clone`
85
+
//~^ ERROR: changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures]
86
+
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`
87
+
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`
89
88
//~| NOTE: for more information, see
90
89
//~| HELP: add a dummy let to cause `f1` to be fully captured
let f1 = U1(S(Foo::from("foo")),T(0),S(Foo::from("bar")));
104
103
let c = || {
105
104
let _ = &f1;
106
-
//~^ ERROR: `Clone` trait implementation for closure and drop order
107
-
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
105
+
//~^ ERROR: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
106
+
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`
108
107
//~| NOTE: for more information, see
109
108
//~| HELP: add a dummy let to cause `f1` to be fully captured
//~^ ERROR: `Sync`, `Send` trait implementation for closure
140
-
//~| NOTE: in Rust 2018, this closure implements `Sync`, `Send` as `fptr1` implements `Sync`, `Send`, but in Rust 2021, this closure will no longer implement `Sync`, `Send` as `fptr1.0.0` does not implement `Sync`, `Send`
141
-
//~| NOTE: in Rust 2018, this closure implements `Send` as `fptr2` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` as `fptr2.0` does not implement `Send`
138
+
//~^ ERROR: changes to closure capture in Rust 2021
139
+
//~| NOTE: in Rust 2018, this closure implements `Sync` as `fptr1` implements `Sync`
140
+
//~| NOTE: in Rust 2018, this closure implements `Send` as `fptr1` implements `Send`
141
+
//~| NOTE: in Rust 2018, this closure implements `Send` as `fptr2` implements `Send`
142
142
//~| NOTE: for more information, see
143
143
//~| HELP: add a dummy let to cause `fptr1`, `fptr2` to be fully captured
Copy file name to clipboardexpand all lines: src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs
+13-13
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,6 @@ impl Foo {
18
18
}
19
19
}
20
20
21
-
22
21
structS(Foo);
23
22
24
23
#[derive(Clone)]
@@ -36,8 +35,8 @@ fn test_multi_issues() {
36
35
let f1 = U(S(Foo::from("foo")),T(0));
37
36
let f2 = U(S(Foo::from("bar")),T(0));
38
37
let c = || {
39
-
//~^ ERROR: `Clone` trait implementation for closure and drop order
40
-
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
38
+
//~^ ERROR: changes to closure capture in Rust 2021
39
+
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`
41
40
//~| NOTE: for more information, see
42
41
//~| HELP: add a dummy let to cause `f1`, `f2` to be fully captured
//~^ ERROR: `Clone` trait implementation for closure
59
-
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
57
+
//~^ ERROR: changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures]
58
+
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`
60
59
//~| NOTE: for more information, see
61
60
//~| HELP: add a dummy let to cause `f1` to be fully captured
let f1 = U1(S(Foo::from("foo")),T(0),S(Foo::from("bar")));
82
81
let c = || {
83
-
//~^ ERROR: `Clone` trait implementation for closure
84
-
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
85
-
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.2` does not implement `Clone`
82
+
//~^ ERROR: changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures]
83
+
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`
84
+
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`
86
85
//~| NOTE: for more information, see
87
86
//~| HELP: add a dummy let to cause `f1` to be fully captured
let f1 = U1(S(Foo::from("foo")),T(0),S(Foo::from("bar")));
101
100
let c = || {
102
-
//~^ ERROR: `Clone` trait implementation for closure and drop order
103
-
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
101
+
//~^ ERROR: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
102
+
//~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`
104
103
//~| NOTE: for more information, see
105
104
//~| HELP: add a dummy let to cause `f1` to be fully captured
//~^ ERROR: `Sync`, `Send` trait implementation for closure
136
-
//~| NOTE: in Rust 2018, this closure implements `Sync`, `Send` as `fptr1` implements `Sync`, `Send`, but in Rust 2021, this closure will no longer implement `Sync`, `Send` as `fptr1.0.0` does not implement `Sync`, `Send`
137
-
//~| NOTE: in Rust 2018, this closure implements `Send` as `fptr2` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` as `fptr2.0` does not implement `Send`
134
+
//~^ ERROR: changes to closure capture in Rust 2021
135
+
//~| NOTE: in Rust 2018, this closure implements `Sync` as `fptr1` implements `Sync`
136
+
//~| NOTE: in Rust 2018, this closure implements `Send` as `fptr1` implements `Send`
137
+
//~| NOTE: in Rust 2018, this closure implements `Send` as `fptr2` implements `Send`
138
138
//~| NOTE: for more information, see
139
139
//~| HELP: add a dummy let to cause `fptr1`, `fptr2` to be fully captured
Copy file name to clipboardexpand all lines: src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr
+18-17
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure and drop order
2
-
--> $DIR/multi_diagnostics.rs:38:13
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
3
|
4
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` as `f1.0` does not implement `Clone`
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
6
...
7
7
LL | let _f_1 = f1.0;
8
8
| ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
@@ -25,11 +25,11 @@ LL ~ let c = || {
25
25
LL + let _ = (&f1, &f2);
26
26
|
27
27
28
-
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure
29
-
--> $DIR/multi_diagnostics.rs:57:13
28
+
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
29
+
--> $DIR/multi_diagnostics.rs:56:13
30
30
|
31
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` as `f1.0` does not implement `Clone`
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
33
...
34
34
LL | let _f_1 = f1.0;
35
35
| ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
@@ -41,14 +41,14 @@ LL ~ let c = || {
41
41
LL + let _ = &f1;
42
42
|
43
43
44
-
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure
45
-
--> $DIR/multi_diagnostics.rs:82:13
44
+
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
45
+
--> $DIR/multi_diagnostics.rs:81:13
46
46
|
47
47
LL | let c = || {
48
48
| ^^
49
49
| |
50
-
| in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `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` as `f1.2` does not implement `Clone`
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
52
...
53
53
LL | let _f_0 = f1.0;
54
54
| ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
@@ -63,11 +63,11 @@ LL ~ let c = || {
63
63
LL + let _ = &f1;
64
64
|
65
65
66
-
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure and drop order
67
-
--> $DIR/multi_diagnostics.rs:101:13
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
68
|
69
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` as `f1.0` does not implement `Clone`
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
71
...
72
72
LL | let _f_0 = f1.0;
73
73
| ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
@@ -88,14 +88,15 @@ LL ~ let c = || {
88
88
LL + let _ = &f1;
89
89
|
90
90
91
-
error: changes to closure capture in Rust 2021 will affect `Sync`, `Send` trait implementation for closure
92
-
--> $DIR/multi_diagnostics.rs:134:19
91
+
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
92
+
--> $DIR/multi_diagnostics.rs:133:19
93
93
|
94
94
LL | thread::spawn(move || unsafe {
95
95
| ^^^^^^^^^^^^^^
96
96
| |
97
-
| in Rust 2018, this closure implements `Sync`, `Send` as `fptr1` implements `Sync`, `Send`, but in Rust 2021, this closure will no longer implement `Sync`, `Send` as `fptr1.0.0` does not implement `Sync`, `Send`
98
-
| in Rust 2018, this closure implements `Send` as `fptr2` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` as `fptr2.0` does not implement `Send`
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`
99
100
...
100
101
LL | *fptr1.0.0 = 20;
101
102
| ---------- in Rust 2018, this closure captures all of `fptr1`, but in Rust 2021, it will only capture `fptr1.0.0`
0 commit comments