Update error format for E0232

This commit is contained in:
Michael Layne 2016-08-18 14:40:59 -07:00
parent 499484f56d
commit 39f318bb4d
No known key found for this signature in database
GPG Key ID: 4EEE3B1A2F8D5CD8
2 changed files with 10 additions and 4 deletions

View File

@ -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();
}
}
}

View File

@ -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() {