diff options
| author | Gavin Baker <gavinb@antonym.org> | 2016-08-29 13:05:06 +1000 |
|---|---|---|
| committer | Gavin Baker <gavinb@antonym.org> | 2016-08-30 09:51:03 +1000 |
| commit | 2967dcc4d7bf0722fb348092a254aaa12deaa6d8 (patch) | |
| tree | 9cb2b042d9ba067b9cbe2f833bba7bd0258ea827 | |
| parent | 28c5edb9f6a35dcd1bf4af102457d26a2de9d76e (diff) | |
| download | rust-2967dcc4d7bf0722fb348092a254aaa12deaa6d8.tar.gz rust-2967dcc4d7bf0722fb348092a254aaa12deaa6d8.zip | |
E0184 Update error format #35275
- Fixes #35275 - Part of #35233 r? @jonathandturner
| -rw-r--r-- | src/librustc_typeck/coherence/mod.rs | 6 | ||||
| -rw-r--r-- | 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 7d6cee7b3ba..f743ef21875 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 5d72d00ffe8..9ec2eeba5cc 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 { |
