From 0e8e89daa6c53b32e866205fd00ba385c66b90de Mon Sep 17 00:00:00 2001 From: Roxane Date: Tue, 6 Jul 2021 16:49:07 -0400 Subject: [PATCH] Update error message --- compiler/rustc_typeck/src/check/upvar.rs | 4 ++-- .../migrations/auto_traits.fixed | 6 +++--- .../migrations/auto_traits.rs | 6 +++--- .../migrations/auto_traits.stderr | 6 +++--- .../migrations/insignificant_drop.stderr | 14 +++++++------- .../insignificant_drop_attr_migrations.stderr | 4 ++-- .../migrations/migrations_rustfix.stderr | 4 ++-- .../migrations/mir_calls_to_shims.fixed | 2 +- .../migrations/mir_calls_to_shims.rs | 2 +- .../migrations/mir_calls_to_shims.stderr | 2 +- .../migrations/precise.stderr | 4 ++-- .../migrations/significant_drop.stderr | 14 +++++++------- 12 files changed, 34 insertions(+), 34 deletions(-) diff --git a/compiler/rustc_typeck/src/check/upvar.rs b/compiler/rustc_typeck/src/check/upvar.rs index 106fea2b2f73..3f042dbd4a56 100644 --- a/compiler/rustc_typeck/src/check/upvar.rs +++ b/compiler/rustc_typeck/src/check/upvar.rs @@ -505,7 +505,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |lint| { let mut diagnostics_builder = lint.build( format!( - "{} will change in Rust 2021", + "changes to closure capture in Rust 2021 will affect {}", reasons ) .as_str(), @@ -567,7 +567,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { if auto_trait_reasons.len() > 0 { reasons = format!( - "{} trait implementation", + "{} closure trait implementation", auto_trait_reasons.clone().into_iter().collect::>().join(", ") ); } diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed index 134d07c400b3..7c7387ff14ee 100644 --- a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed +++ b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed @@ -11,7 +11,7 @@ fn test_send_trait() { let mut f = 10; let fptr = SendPointer(&mut f as *mut i32); thread::spawn(move || { let _ = &fptr; unsafe { - //~^ ERROR: `Send` trait implementation + //~^ ERROR: `Send` closure trait implementation //~| HELP: add a dummy let to cause `fptr` to be fully captured *fptr.0 = 20; } }); @@ -28,7 +28,7 @@ fn test_sync_trait() { let f = CustomInt(&mut f as *mut i32); let fptr = SyncPointer(f); thread::spawn(move || { let _ = &fptr; unsafe { - //~^ ERROR: `Sync`, `Send` trait implementation + //~^ ERROR: `Sync`, `Send` closure trait implementation //~| HELP: add a dummy let to cause `fptr` to be fully captured *fptr.0.0 = 20; } }); @@ -49,7 +49,7 @@ impl Clone for U { fn test_clone_trait() { let f = U(S(String::from("Hello World")), T(0)); let c = || { let _ = &f; - //~^ ERROR: `Clone` trait implementation, and drop order + //~^ ERROR: `Clone` closure trait implementation, and drop order //~| HELP: add a dummy let to cause `f` to be fully captured let f_1 = f.1; println!("{:?}", f_1.0); diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.rs b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.rs index b48a724f052f..e606a206b3b7 100644 --- a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.rs +++ b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.rs @@ -11,7 +11,7 @@ fn test_send_trait() { let mut f = 10; let fptr = SendPointer(&mut f as *mut i32); thread::spawn(move || unsafe { - //~^ ERROR: `Send` trait implementation + //~^ ERROR: `Send` closure trait implementation //~| HELP: add a dummy let to cause `fptr` to be fully captured *fptr.0 = 20; }); @@ -28,7 +28,7 @@ fn test_sync_trait() { let f = CustomInt(&mut f as *mut i32); let fptr = SyncPointer(f); thread::spawn(move || unsafe { - //~^ ERROR: `Sync`, `Send` trait implementation + //~^ ERROR: `Sync`, `Send` closure trait implementation //~| HELP: add a dummy let to cause `fptr` to be fully captured *fptr.0.0 = 20; }); @@ -49,7 +49,7 @@ impl Clone for U { fn test_clone_trait() { let f = U(S(String::from("Hello World")), T(0)); let c = || { - //~^ ERROR: `Clone` trait implementation, and drop order + //~^ ERROR: `Clone` closure trait implementation, and drop order //~| HELP: add a dummy let to cause `f` to be fully captured let f_1 = f.1; println!("{:?}", f_1.0); diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr index 39b9dc2e22fa..b628c5c3fad9 100644 --- a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr +++ b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr @@ -1,4 +1,4 @@ -error: `Send` trait implementation will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect `Send` closure trait implementation --> $DIR/auto_traits.rs:13:19 | LL | thread::spawn(move || unsafe { @@ -25,7 +25,7 @@ LL | *fptr.0 = 20; LL | } }); | -error: `Sync`, `Send` trait implementation will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect `Sync`, `Send` closure trait implementation --> $DIR/auto_traits.rs:30:19 | LL | thread::spawn(move || unsafe { @@ -47,7 +47,7 @@ LL | *fptr.0.0 = 20; LL | } }); | -error: `Clone` trait implementation, and drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect `Clone` closure trait implementation, and drop order --> $DIR/auto_traits.rs:51:13 | LL | let c = || { diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.stderr index 64708027383d..11b90a700551 100644 --- a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.stderr +++ b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.stderr @@ -1,4 +1,4 @@ -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/insignificant_drop.rs:15:13 | LL | let c = || { @@ -35,7 +35,7 @@ LL | LL | let _t = t.0; ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/insignificant_drop.rs:38:13 | LL | let c = || { @@ -64,7 +64,7 @@ LL | let _t = t.0; LL | ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/insignificant_drop.rs:57:13 | LL | let c = || { @@ -90,7 +90,7 @@ LL | let _t = t.0; LL | ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/insignificant_drop.rs:77:13 | LL | let c = || { @@ -116,7 +116,7 @@ LL | let _t = t.0; LL | ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/insignificant_drop.rs:97:13 | LL | let c = || { @@ -142,7 +142,7 @@ LL | let _t = t.0; LL | ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/insignificant_drop.rs:114:13 | LL | let c = move || { @@ -170,7 +170,7 @@ LL | println!("{} {}", t1.1, t.1); LL | ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/insignificant_drop.rs:132:13 | LL | let c = || { diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr index 478b331f7fa5..b328abfeb52a 100644 --- a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr +++ b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr @@ -1,4 +1,4 @@ -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/insignificant_drop_attr_migrations.rs:37:13 | LL | let c = || { @@ -28,7 +28,7 @@ LL | let _t = t.0; LL | ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/insignificant_drop_attr_migrations.rs:56:13 | LL | let c = move || { diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr index 58109128c2c0..a4426c79a166 100644 --- a/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr +++ b/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr @@ -1,4 +1,4 @@ -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/migrations_rustfix.rs:19:13 | LL | let c = || { @@ -29,7 +29,7 @@ LL | let _t = t.0; LL | ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/migrations_rustfix.rs:33:13 | LL | let c = || t.0; diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed index 7f49b460ef63..309a3c4a70bf 100644 --- a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed +++ b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed @@ -17,7 +17,7 @@ where { let f = panic::AssertUnwindSafe(f); let result = panic::catch_unwind(move || { let _ = &f; - //~^ ERROR: `UnwindSafe`, `RefUnwindSafe` trait implementation + //~^ ERROR: `UnwindSafe`, `RefUnwindSafe` closure trait implementation //~| HELP: add a dummy let to cause `f` to be fully captured f.0() }); diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs index 3c654bec5260..690e509b318b 100644 --- a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs +++ b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs @@ -17,7 +17,7 @@ where { let f = panic::AssertUnwindSafe(f); let result = panic::catch_unwind(move || { - //~^ ERROR: `UnwindSafe`, `RefUnwindSafe` trait implementation + //~^ ERROR: `UnwindSafe`, `RefUnwindSafe` closure trait implementation //~| HELP: add a dummy let to cause `f` to be fully captured f.0() }); diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr index 2513ceecc699..3925a0fdb980 100644 --- a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr +++ b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr @@ -1,4 +1,4 @@ -error: `UnwindSafe`, `RefUnwindSafe` trait implementation will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect `UnwindSafe`, `RefUnwindSafe` closure trait implementation --> $DIR/mir_calls_to_shims.rs:19:38 | LL | let result = panic::catch_unwind(move || { diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr index 09829123db3f..00ee8b1f0543 100644 --- a/src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr +++ b/src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr @@ -1,4 +1,4 @@ -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/precise.rs:19:13 | LL | let c = || { @@ -27,7 +27,7 @@ LL | let _t = &t.1; LL | }; | -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/precise.rs:41:13 | LL | let c = || { diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr index fa4903b76bad..f715ea9a48f7 100644 --- a/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr +++ b/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr @@ -1,4 +1,4 @@ -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/significant_drop.rs:25:13 | LL | let c = || { @@ -34,7 +34,7 @@ LL | let _t = t.0; LL | ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/significant_drop.rs:47:13 | LL | let c = || { @@ -63,7 +63,7 @@ LL | let _t = t.0; LL | ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/significant_drop.rs:66:13 | LL | let c = || { @@ -89,7 +89,7 @@ LL | let _t = t.0; LL | ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/significant_drop.rs:85:13 | LL | let c = || { @@ -114,7 +114,7 @@ LL | let _t = t.0; LL | ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/significant_drop.rs:102:13 | LL | let c = || { @@ -139,7 +139,7 @@ LL | let _t = t.0; LL | ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/significant_drop.rs:117:13 | LL | let c = || { @@ -164,7 +164,7 @@ LL | let _t = t.1; LL | ... -error: drop order will change in Rust 2021 +error: changes to closure capture in Rust 2021 will affect drop order --> $DIR/significant_drop.rs:134:13 | LL | let c = move || {