]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/coherence/mod.rs
Auto merge of #35856 - phimuemue:master, r=brson
[rust.git] / src / librustc_typeck / coherence / mod.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();
                 }
             }
         });