]> git.lizzy.rs Git - rust.git/commitdiff
E0184 Update error format #35275
authorGavin Baker <gavinb@antonym.org>
Mon, 29 Aug 2016 03:05:06 +0000 (13:05 +1000)
committerGavin Baker <gavinb@antonym.org>
Mon, 29 Aug 2016 23:51:03 +0000 (09:51 +1000)
- Fixes #35275
- Part of #35233

r? @jonathandturner

src/librustc_typeck/coherence/mod.rs
src/test/compile-fail/E0184.rs

index 7d6cee7b3bac16767e64d653f5a727b166f22061..f743ef21875611434fb9de7de52911f2f8bf2d49 100644 (file)
@@ -348,9 +348,11 @@ fn check_implementations_of_copy(&self) {
                         .emit();
                 }
                 Err(CopyImplementationError::HasDestructor) => {
-                    span_err!(tcx.sess, span, E0184,
+                    struct_span_err!(tcx.sess, span, E0184,
                               "the trait `Copy` may not be implemented for this type; \
-                               the type has a destructor");
+                               the type has a destructor")
+                        .span_label(span, &format!("Copy not allowed on types with destructors"))
+                        .emit();
                 }
             }
         });
index 5d72d00ffe8765bb7ade9cda1f14eb4afa4ccd2d..9ec2eeba5cc5f5a0ff49c0383d0dc1de0bd9466e 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 #[derive(Copy)] //~ ERROR E0184
+                //~| NOTE Copy not allowed on types with destructors
+                //~| NOTE in this expansion of #[derive(Copy)]
 struct Foo;
 
 impl Drop for Foo {