diff options
| author | Michael Layne <mlayne@fastmail.com> | 2016-08-18 14:40:59 -0700 |
|---|---|---|
| committer | Michael Layne <mlayne@fastmail.com> | 2016-08-18 15:31:34 -0700 |
| commit | 39f318bb4d7144a8deb10f520a01164133c1b6ec (patch) | |
| tree | 73603c80063769c4022a1230bbc52e7feda7d471 | |
| parent | 499484f56d336f4628a6fa016626beb3ef21ba81 (diff) | |
| download | rust-39f318bb4d7144a8deb10f520a01164133c1b6ec.tar.gz rust-39f318bb4d7144a8deb10f520a01164133c1b6ec.zip | |
Update error format for E0232
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 9 | ||||
| -rw-r--r-- | src/test/compile-fail/E0232.rs | 5 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index ff0b86aa595..3a21ffb5e7d 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -903,9 +903,12 @@ fn check_on_unimplemented<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, } } } else { - span_err!(ccx.tcx.sess, attr.span, E0232, - "this attribute must have a value, \ - eg `#[rustc_on_unimplemented = \"foo\"]`") + struct_span_err!( + ccx.tcx.sess, attr.span, E0232, + "this attribute must have a value") + .span_label(attr.span, &format!("attribute requires a value")) + .note(&format!("eg `#[rustc_on_unimplemented = \"foo\"]`")) + .emit(); } } } diff --git a/src/test/compile-fail/E0232.rs b/src/test/compile-fail/E0232.rs index efeb869d71f..ce4f4638dac 100644 --- a/src/test/compile-fail/E0232.rs +++ b/src/test/compile-fail/E0232.rs @@ -10,7 +10,10 @@ #![feature(on_unimplemented)] -#[rustc_on_unimplemented] //~ ERROR E0232 +#[rustc_on_unimplemented] +//~^ ERROR E0232 +//~| NOTE attribute requires a value +//~| NOTE eg `#[rustc_on_unimplemented = "foo"]` trait Bar {} fn main() { |
