From 2967dcc4d7bf0722fb348092a254aaa12deaa6d8 Mon Sep 17 00:00:00 2001 From: Gavin Baker Date: Mon, 29 Aug 2016 13:05:06 +1000 Subject: [PATCH] E0184 Update error format #35275 - Fixes #35275 - Part of #35233 r? @jonathandturner --- src/librustc_typeck/coherence/mod.rs | 6 ++++-- src/test/compile-fail/E0184.rs | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/librustc_typeck/coherence/mod.rs b/src/librustc_typeck/coherence/mod.rs index 7d6cee7b3bac1..f743ef2187561 100644 --- a/src/librustc_typeck/coherence/mod.rs +++ b/src/librustc_typeck/coherence/mod.rs @@ -348,9 +348,11 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> { .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(); } } }); diff --git a/src/test/compile-fail/E0184.rs b/src/test/compile-fail/E0184.rs index 5d72d00ffe876..9ec2eeba5cc5f 100644 --- a/src/test/compile-fail/E0184.rs +++ b/src/test/compile-fail/E0184.rs @@ -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 {