diff options
| author | Jonathan Turner <jonathandturner@users.noreply.github.com> | 2016-08-07 09:59:45 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-07 09:59:45 -0700 |
| commit | 995eeb02cab03914b23eb97836c0c286df8c5e40 (patch) | |
| tree | 156e2096bdb53d7e1ee9dc2d2cfc0900e61bddb5 | |
| parent | 8bd8cef3181c30f0d8c55014fe9019d70272ba5f (diff) | |
| parent | 0b248f1d29b218faf83699b7e0b1f696e8d32f55 (diff) | |
| download | rust-995eeb02cab03914b23eb97836c0c286df8c5e40.tar.gz rust-995eeb02cab03914b23eb97836c0c286df8c5e40.zip | |
Rollup merge of #35468 - munyari:e0205, r=jonathandturner
Update E0205 to the new error format Part of #35233 Addresses #35382 "r? @jonathandturner
| -rw-r--r-- | src/librustc_typeck/coherence/mod.rs | 8 | ||||
| -rw-r--r-- | src/test/compile-fail/E0205.rs | 9 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/librustc_typeck/coherence/mod.rs b/src/librustc_typeck/coherence/mod.rs index 1cc81580a6f..939d81bf847 100644 --- a/src/librustc_typeck/coherence/mod.rs +++ b/src/librustc_typeck/coherence/mod.rs @@ -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, diff --git a/src/test/compile-fail/E0205.rs b/src/test/compile-fail/E0205.rs index e4781bba08a..37ac57af524 100644 --- a/src/test/compile-fail/E0205.rs +++ b/src/test/compile-fail/E0205.rs @@ -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, |
