about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPanashe M. Fundira <fundirap@gmail.com>2016-08-07 12:47:53 -0400
committerPanashe M. Fundira <fundirap@gmail.com>2016-08-07 12:47:53 -0400
commit0b248f1d29b218faf83699b7e0b1f696e8d32f55 (patch)
tree9f1dca565eec3c723e936f0f0ebfaceacc0b435a
parent42903d9a8f0f471f5e0eb453e49fe44a65a746c5 (diff)
downloadrust-0b248f1d29b218faf83699b7e0b1f696e8d32f55.tar.gz
rust-0b248f1d29b218faf83699b7e0b1f696e8d32f55.zip
Update E0205 to the new error format
-rw-r--r--src/librustc_typeck/coherence/mod.rs8
-rw-r--r--src/test/compile-fail/E0205.rs9
2 files changed, 12 insertions, 5 deletions
diff --git a/src/librustc_typeck/coherence/mod.rs b/src/librustc_typeck/coherence/mod.rs
index 2d14b0dacf2..629edf3ff3b 100644
--- a/src/librustc_typeck/coherence/mod.rs
+++ b/src/librustc_typeck/coherence/mod.rs
@@ -318,11 +318,13 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> {
                                          name)
                 }
                 Err(CopyImplementationError::InfrigingVariant(name)) => {
-                       span_err!(tcx.sess, span, E0205,
+                       struct_span_err!(tcx.sess, span, E0205,
                                  "the trait `Copy` may not be \
-                                          implemented for this type; variant \
+                                          implemented for this type")
+                           .span_label(span, &format!("variant \
                                           `{}` does not implement `Copy`",
-                                         name)
+                                         name))
+                           .emit()
                 }
                 Err(CopyImplementationError::NotAnAdt) => {
                        span_err!(tcx.sess, span, E0206,
diff --git a/src/test/compile-fail/E0205.rs b/src/test/compile-fail/E0205.rs
index e4781bba08a..37ac57af524 100644
--- a/src/test/compile-fail/E0205.rs
+++ b/src/test/compile-fail/E0205.rs
@@ -13,9 +13,14 @@ enum Foo {
     Baz,
 }
 
-impl Copy for Foo { } //~ ERROR E0205
+impl Copy for Foo { }
+//~^ ERROR E0205
+//~| NOTE variant `Bar` does not implement `Copy`
 
-#[derive(Copy)] //~ ERROR E0205
+#[derive(Copy)]
+//~^ ERROR E0205
+//~| NOTE variant `Bar` does not implement `Copy`
+//~| NOTE in this expansion of #[derive(Copy)]
 enum Foo2<'a> {
     Bar(&'a mut bool),
     Baz,