Skip to content

Commit 0b248f1

Browse files
committed
Update E0205 to the new error format
1 parent 42903d9 commit 0b248f1

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/librustc_typeck/coherence/mod.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,13 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> {
318318
name)
319319
}
320320
Err(CopyImplementationError::InfrigingVariant(name)) => {
321-
span_err!(tcx.sess, span, E0205,
321+
struct_span_err!(tcx.sess, span, E0205,
322322
"the trait `Copy` may not be \
323-
implemented for this type; variant \
323+
implemented for this type")
324+
.span_label(span, &format!("variant \
324325
`{}` does not implement `Copy`",
325-
name)
326+
name))
327+
.emit()
326328
}
327329
Err(CopyImplementationError::NotAnAdt) => {
328330
span_err!(tcx.sess, span, E0206,

src/test/compile-fail/E0205.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ enum Foo {
1313
Baz,
1414
}
1515

16-
impl Copy for Foo { } //~ ERROR E0205
16+
impl Copy for Foo { }
17+
//~^ ERROR E0205
18+
//~| NOTE variant `Bar` does not implement `Copy`
1719

18-
#[derive(Copy)] //~ ERROR E0205
20+
#[derive(Copy)]
21+
//~^ ERROR E0205
22+
//~| NOTE variant `Bar` does not implement `Copy`
23+
//~| NOTE in this expansion of #[derive(Copy)]
1924
enum Foo2<'a> {
2025
Bar(&'a mut bool),
2126
Baz,

0 commit comments

Comments
 (0)