Skip to content

Commit

Permalink
E0184 Update error format #35275
Browse files Browse the repository at this point in the history
- Fixes #35275
- Part of #35233

r? @jonathandturner
  • Loading branch information
gavinb committed Aug 29, 2016
1 parent 28c5edb commit 2967dcc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustc_typeck/coherence/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
});
Expand Down
2 changes: 2 additions & 0 deletions src/test/compile-fail/E0184.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2967dcc

Please sign in to comment.