Skip to content

Commit

Permalink
Rollup merge of rust-lang#35812 - mlayne:E0232, r=jonathandturner
Browse files Browse the repository at this point in the history
Update error format for E0232

Fixes rust-lang#35795, as part of rust-lang#35233.

Excited to make my first contribution to rustc!

r? @jonathandturner
  • Loading branch information
Jonathan Turner authored Aug 20, 2016
2 parents 860dd68 + 39f318b commit 53a09ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
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

0 comments on commit 53a09ac

Please sign in to comment.