Skip to content

Commit 0e8e89d

Browse files
committed
Update error message
1 parent 0b7ff96 commit 0e8e89d

File tree

12 files changed

+34
-34
lines changed

12 files changed

+34
-34
lines changed

compiler/rustc_typeck/src/check/upvar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
505505
|lint| {
506506
let mut diagnostics_builder = lint.build(
507507
format!(
508-
"{} will change in Rust 2021",
508+
"changes to closure capture in Rust 2021 will affect {}",
509509
reasons
510510
)
511511
.as_str(),
@@ -567,7 +567,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
567567

568568
if auto_trait_reasons.len() > 0 {
569569
reasons = format!(
570-
"{} trait implementation",
570+
"{} closure trait implementation",
571571
auto_trait_reasons.clone().into_iter().collect::<Vec<&str>>().join(", ")
572572
);
573573
}

src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn test_send_trait() {
1111
let mut f = 10;
1212
let fptr = SendPointer(&mut f as *mut i32);
1313
thread::spawn(move || { let _ = &fptr; unsafe {
14-
//~^ ERROR: `Send` trait implementation
14+
//~^ ERROR: `Send` closure trait implementation
1515
//~| HELP: add a dummy let to cause `fptr` to be fully captured
1616
*fptr.0 = 20;
1717
} });
@@ -28,7 +28,7 @@ fn test_sync_trait() {
2828
let f = CustomInt(&mut f as *mut i32);
2929
let fptr = SyncPointer(f);
3030
thread::spawn(move || { let _ = &fptr; unsafe {
31-
//~^ ERROR: `Sync`, `Send` trait implementation
31+
//~^ ERROR: `Sync`, `Send` closure trait implementation
3232
//~| HELP: add a dummy let to cause `fptr` to be fully captured
3333
*fptr.0.0 = 20;
3434
} });
@@ -49,7 +49,7 @@ impl Clone for U {
4949
fn test_clone_trait() {
5050
let f = U(S(String::from("Hello World")), T(0));
5151
let c = || { let _ = &f;
52-
//~^ ERROR: `Clone` trait implementation, and drop order
52+
//~^ ERROR: `Clone` closure trait implementation, and drop order
5353
//~| HELP: add a dummy let to cause `f` to be fully captured
5454
let f_1 = f.1;
5555
println!("{:?}", f_1.0);

src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn test_send_trait() {
1111
let mut f = 10;
1212
let fptr = SendPointer(&mut f as *mut i32);
1313
thread::spawn(move || unsafe {
14-
//~^ ERROR: `Send` trait implementation
14+
//~^ ERROR: `Send` closure trait implementation
1515
//~| HELP: add a dummy let to cause `fptr` to be fully captured
1616
*fptr.0 = 20;
1717
});
@@ -28,7 +28,7 @@ fn test_sync_trait() {
2828
let f = CustomInt(&mut f as *mut i32);
2929
let fptr = SyncPointer(f);
3030
thread::spawn(move || unsafe {
31-
//~^ ERROR: `Sync`, `Send` trait implementation
31+
//~^ ERROR: `Sync`, `Send` closure trait implementation
3232
//~| HELP: add a dummy let to cause `fptr` to be fully captured
3333
*fptr.0.0 = 20;
3434
});
@@ -49,7 +49,7 @@ impl Clone for U {
4949
fn test_clone_trait() {
5050
let f = U(S(String::from("Hello World")), T(0));
5151
let c = || {
52-
//~^ ERROR: `Clone` trait implementation, and drop order
52+
//~^ ERROR: `Clone` closure trait implementation, and drop order
5353
//~| HELP: add a dummy let to cause `f` to be fully captured
5454
let f_1 = f.1;
5555
println!("{:?}", f_1.0);

src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: `Send` trait implementation will change in Rust 2021
1+
error: changes to closure capture in Rust 2021 will affect `Send` closure trait implementation
22
--> $DIR/auto_traits.rs:13:19
33
|
44
LL | thread::spawn(move || unsafe {
@@ -25,7 +25,7 @@ LL | *fptr.0 = 20;
2525
LL | } });
2626
|
2727

28-
error: `Sync`, `Send` trait implementation will change in Rust 2021
28+
error: changes to closure capture in Rust 2021 will affect `Sync`, `Send` closure trait implementation
2929
--> $DIR/auto_traits.rs:30:19
3030
|
3131
LL | thread::spawn(move || unsafe {
@@ -47,7 +47,7 @@ LL | *fptr.0.0 = 20;
4747
LL | } });
4848
|
4949

50-
error: `Clone` trait implementation, and drop order will change in Rust 2021
50+
error: changes to closure capture in Rust 2021 will affect `Clone` closure trait implementation, and drop order
5151
--> $DIR/auto_traits.rs:51:13
5252
|
5353
LL | let c = || {

src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: drop order will change in Rust 2021
1+
error: changes to closure capture in Rust 2021 will affect drop order
22
--> $DIR/insignificant_drop.rs:15:13
33
|
44
LL | let c = || {
@@ -35,7 +35,7 @@ LL |
3535
LL | let _t = t.0;
3636
...
3737

38-
error: drop order will change in Rust 2021
38+
error: changes to closure capture in Rust 2021 will affect drop order
3939
--> $DIR/insignificant_drop.rs:38:13
4040
|
4141
LL | let c = || {
@@ -64,7 +64,7 @@ LL | let _t = t.0;
6464
LL |
6565
...
6666

67-
error: drop order will change in Rust 2021
67+
error: changes to closure capture in Rust 2021 will affect drop order
6868
--> $DIR/insignificant_drop.rs:57:13
6969
|
7070
LL | let c = || {
@@ -90,7 +90,7 @@ LL | let _t = t.0;
9090
LL |
9191
...
9292

93-
error: drop order will change in Rust 2021
93+
error: changes to closure capture in Rust 2021 will affect drop order
9494
--> $DIR/insignificant_drop.rs:77:13
9595
|
9696
LL | let c = || {
@@ -116,7 +116,7 @@ LL | let _t = t.0;
116116
LL |
117117
...
118118

119-
error: drop order will change in Rust 2021
119+
error: changes to closure capture in Rust 2021 will affect drop order
120120
--> $DIR/insignificant_drop.rs:97:13
121121
|
122122
LL | let c = || {
@@ -142,7 +142,7 @@ LL | let _t = t.0;
142142
LL |
143143
...
144144

145-
error: drop order will change in Rust 2021
145+
error: changes to closure capture in Rust 2021 will affect drop order
146146
--> $DIR/insignificant_drop.rs:114:13
147147
|
148148
LL | let c = move || {
@@ -170,7 +170,7 @@ LL | println!("{} {}", t1.1, t.1);
170170
LL |
171171
...
172172

173-
error: drop order will change in Rust 2021
173+
error: changes to closure capture in Rust 2021 will affect drop order
174174
--> $DIR/insignificant_drop.rs:132:13
175175
|
176176
LL | let c = || {

src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: drop order will change in Rust 2021
1+
error: changes to closure capture in Rust 2021 will affect drop order
22
--> $DIR/insignificant_drop_attr_migrations.rs:37:13
33
|
44
LL | let c = || {
@@ -28,7 +28,7 @@ LL | let _t = t.0;
2828
LL |
2929
...
3030

31-
error: drop order will change in Rust 2021
31+
error: changes to closure capture in Rust 2021 will affect drop order
3232
--> $DIR/insignificant_drop_attr_migrations.rs:56:13
3333
|
3434
LL | let c = move || {

src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: drop order will change in Rust 2021
1+
error: changes to closure capture in Rust 2021 will affect drop order
22
--> $DIR/migrations_rustfix.rs:19:13
33
|
44
LL | let c = || {
@@ -29,7 +29,7 @@ LL | let _t = t.0;
2929
LL |
3030
...
3131

32-
error: drop order will change in Rust 2021
32+
error: changes to closure capture in Rust 2021 will affect drop order
3333
--> $DIR/migrations_rustfix.rs:33:13
3434
|
3535
LL | let c = || t.0;

src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ where
1717
{
1818
let f = panic::AssertUnwindSafe(f);
1919
let result = panic::catch_unwind(move || { let _ = &f;
20-
//~^ ERROR: `UnwindSafe`, `RefUnwindSafe` trait implementation
20+
//~^ ERROR: `UnwindSafe`, `RefUnwindSafe` closure trait implementation
2121
//~| HELP: add a dummy let to cause `f` to be fully captured
2222
f.0()
2323
});

src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ where
1717
{
1818
let f = panic::AssertUnwindSafe(f);
1919
let result = panic::catch_unwind(move || {
20-
//~^ ERROR: `UnwindSafe`, `RefUnwindSafe` trait implementation
20+
//~^ ERROR: `UnwindSafe`, `RefUnwindSafe` closure trait implementation
2121
//~| HELP: add a dummy let to cause `f` to be fully captured
2222
f.0()
2323
});

src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: `UnwindSafe`, `RefUnwindSafe` trait implementation will change in Rust 2021
1+
error: changes to closure capture in Rust 2021 will affect `UnwindSafe`, `RefUnwindSafe` closure trait implementation
22
--> $DIR/mir_calls_to_shims.rs:19:38
33
|
44
LL | let result = panic::catch_unwind(move || {

src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: drop order will change in Rust 2021
1+
error: changes to closure capture in Rust 2021 will affect drop order
22
--> $DIR/precise.rs:19:13
33
|
44
LL | let c = || {
@@ -27,7 +27,7 @@ LL | let _t = &t.1;
2727
LL | };
2828
|
2929

30-
error: drop order will change in Rust 2021
30+
error: changes to closure capture in Rust 2021 will affect drop order
3131
--> $DIR/precise.rs:41:13
3232
|
3333
LL | let c = || {

src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: drop order will change in Rust 2021
1+
error: changes to closure capture in Rust 2021 will affect drop order
22
--> $DIR/significant_drop.rs:25:13
33
|
44
LL | let c = || {
@@ -34,7 +34,7 @@ LL | let _t = t.0;
3434
LL |
3535
...
3636

37-
error: drop order will change in Rust 2021
37+
error: changes to closure capture in Rust 2021 will affect drop order
3838
--> $DIR/significant_drop.rs:47:13
3939
|
4040
LL | let c = || {
@@ -63,7 +63,7 @@ LL | let _t = t.0;
6363
LL |
6464
...
6565

66-
error: drop order will change in Rust 2021
66+
error: changes to closure capture in Rust 2021 will affect drop order
6767
--> $DIR/significant_drop.rs:66:13
6868
|
6969
LL | let c = || {
@@ -89,7 +89,7 @@ LL | let _t = t.0;
8989
LL |
9090
...
9191

92-
error: drop order will change in Rust 2021
92+
error: changes to closure capture in Rust 2021 will affect drop order
9393
--> $DIR/significant_drop.rs:85:13
9494
|
9595
LL | let c = || {
@@ -114,7 +114,7 @@ LL | let _t = t.0;
114114
LL |
115115
...
116116

117-
error: drop order will change in Rust 2021
117+
error: changes to closure capture in Rust 2021 will affect drop order
118118
--> $DIR/significant_drop.rs:102:13
119119
|
120120
LL | let c = || {
@@ -139,7 +139,7 @@ LL | let _t = t.0;
139139
LL |
140140
...
141141

142-
error: drop order will change in Rust 2021
142+
error: changes to closure capture in Rust 2021 will affect drop order
143143
--> $DIR/significant_drop.rs:117:13
144144
|
145145
LL | let c = || {
@@ -164,7 +164,7 @@ LL | let _t = t.1;
164164
LL |
165165
...
166166

167-
error: drop order will change in Rust 2021
167+
error: changes to closure capture in Rust 2021 will affect drop order
168168
--> $DIR/significant_drop.rs:134:13
169169
|
170170
LL | let c = move || {

0 commit comments

Comments
 (0)