Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/test/compile-fail/E0232.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down