about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobin Kruppe <robin.kruppe@gmail.com>2016-05-17 00:40:27 +0200
committerRobin Kruppe <robin.kruppe@gmail.com>2016-05-19 11:02:41 +0200
commite575d19acc095d2aeec58176e51a9551fa2e6e88 (patch)
treea562cc5b0efd1b6c047ade3ec72c0842b5a43167
parent0c5d651d0bb9e0471795bd743c8ecfd8f9a89844 (diff)
downloadrust-e575d19acc095d2aeec58176e51a9551fa2e6e88.tar.gz
rust-e575d19acc095d2aeec58176e51a9551fa2e6e88.zip
Reword the short diagnostic for E0509
Saying that a type *implements* a trait is much more idiomatic than saying it *defines* the trait.
-rw-r--r--src/librustc_borrowck/borrowck/gather_loans/move_error.rs2
-rw-r--r--src/test/compile-fail/borrowck/borrowck-move-error-with-note.rs2
-rw-r--r--src/test/compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs6
-rw-r--r--src/test/compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs6
-rw-r--r--src/test/compile-fail/borrowck/borrowck-struct-update-with-dtor.rs6
-rw-r--r--src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs2
6 files changed, 13 insertions, 11 deletions
diff --git a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs
index 5ebb1ab32b8..c1e83588570 100644
--- a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs
+++ b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs
@@ -152,7 +152,7 @@ fn report_cannot_move_out_of<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
                 ty::TyEnum(def, _) if def.has_dtor() => {
                     let mut err = struct_span_err!(bccx, move_from.span, E0509,
                                                    "cannot move out of type `{}`, \
-                                                   which defines the `Drop` trait",
+                                                   which implements the `Drop` trait",
                                                    b.ty);
                     err.span_label(move_from.span, &format!("cannot move out of here"));
                     err
diff --git a/src/test/compile-fail/borrowck/borrowck-move-error-with-note.rs b/src/test/compile-fail/borrowck/borrowck-move-error-with-note.rs
index 438a548819b..5d9c9d0bd46 100644
--- a/src/test/compile-fail/borrowck/borrowck-move-error-with-note.rs
+++ b/src/test/compile-fail/borrowck/borrowck-move-error-with-note.rs
@@ -37,7 +37,7 @@ impl Drop for S {
 
 fn move_in_match() {
     match (S {f: "foo".to_string(), g: "bar".to_string()}) {
-        S {         //~ ERROR cannot move out of type `S`, which defines the `Drop` trait
+        S {         //~ ERROR cannot move out of type `S`, which implements the `Drop` trait
         //~| cannot move out of here
             f: _s,  //~ NOTE to prevent move
             g: _t   //~ NOTE and here
diff --git a/src/test/compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs b/src/test/compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs
index 3d13cbe30c5..16302d276ce 100644
--- a/src/test/compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs
+++ b/src/test/compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs
@@ -16,17 +16,17 @@ impl Drop for S {
 fn move_in_match() {
     match (S {f:"foo".to_string()}) {
         S {f:_s} => {}
-        //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
+        //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
     }
 }
 
 fn move_in_let() {
     let S {f:_s} = S {f:"foo".to_string()};
-    //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
+    //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
 }
 
 fn move_in_fn_arg(S {f:_s}: S) {
-    //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
+    //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs b/src/test/compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs
index 625f7184905..f5fedb8d487 100644
--- a/src/test/compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs
+++ b/src/test/compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs
@@ -16,17 +16,17 @@ impl Drop for S {
 fn move_in_match() {
     match S("foo".to_string()) {
         S(_s) => {}
-        //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
+        //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
     }
 }
 
 fn move_in_let() {
     let S(_s) = S("foo".to_string());
-    //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
+    //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
 }
 
 fn move_in_fn_arg(S(_s): S) {
-    //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
+    //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/borrowck/borrowck-struct-update-with-dtor.rs b/src/test/compile-fail/borrowck/borrowck-struct-update-with-dtor.rs
index bf1497420e2..c364788a9cc 100644
--- a/src/test/compile-fail/borrowck/borrowck-struct-update-with-dtor.rs
+++ b/src/test/compile-fail/borrowck/borrowck-struct-update-with-dtor.rs
@@ -19,11 +19,13 @@ struct T { a: isize, mv: Box<isize> }
 impl Drop for T { fn drop(&mut self) { } }
 
 fn f(s0:S) {
-    let _s2 = S{a: 2, ..s0}; //~error: cannot move out of type `S`, which defines the `Drop` trait
+    let _s2 = S{a: 2, ..s0};
+    //~^ error: cannot move out of type `S`, which implements the `Drop` trait
 }
 
 fn g(s0:T) {
-    let _s2 = T{a: 2, ..s0}; //~error: cannot move out of type `T`, which defines the `Drop` trait
+    let _s2 = T{a: 2, ..s0};
+    //~^ error: cannot move out of type `T`, which implements the `Drop` trait
 }
 
 fn main() { }
diff --git a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs b/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs
index 5078009d4b2..38049209903 100644
--- a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs
+++ b/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs
@@ -23,6 +23,6 @@ fn main() {
 
     match x {
         X { x: y } => println!("contents: {}", y)
-        //~^ ERROR cannot move out of type `X`, which defines the `Drop` trait
+        //~^ ERROR cannot move out of type `X`, which implements the `Drop` trait
     }
 }