Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/librustc_typeck/coherence/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,13 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> {
name)
}
Err(CopyImplementationError::InfrigingVariant(name)) => {
span_err!(tcx.sess, span, E0205,
struct_span_err!(tcx.sess, span, E0205,
"the trait `Copy` may not be \
implemented for this type; variant \
implemented for this type")
.span_label(span, &format!("variant \
`{}` does not implement `Copy`",
name)
name))
.emit()
}
Err(CopyImplementationError::NotAnAdt) => {
span_err!(tcx.sess, span, E0206,
Expand Down
9 changes: 7 additions & 2 deletions src/test/compile-fail/E0205.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ enum Foo {
Baz,
}

impl Copy for Foo { } //~ ERROR E0205
impl Copy for Foo { }
//~^ ERROR E0205
//~| NOTE variant `Bar` does not implement `Copy`

#[derive(Copy)] //~ ERROR E0205
#[derive(Copy)]
//~^ ERROR E0205
//~| NOTE variant `Bar` does not implement `Copy`
//~| NOTE in this expansion of #[derive(Copy)]
enum Foo2<'a> {
Bar(&'a mut bool),
Baz,
Expand Down