Skip to content

Commit

Permalink
Rollup merge of rust-lang#35468 - munyari:e0205, r=jonathandturner
Browse files Browse the repository at this point in the history
Update E0205 to the new error format

Part of rust-lang#35233

Addresses rust-lang#35382
"r? @jonathandturner
  • Loading branch information
Jonathan Turner authored Aug 7, 2016
2 parents 8bd8cef + 0b248f1 commit 995eeb0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/librustc_typeck/coherence/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,13 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> {

}
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

0 comments on commit 995eeb0

Please sign in to comment.