Skip to content

Commit

Permalink
E0518 Update error format rust-lang#36111
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinb committed Sep 5, 2016
1 parent 8bcd6a3 commit cd56d47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustc/hir/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ struct CheckAttrVisitor<'a> {
impl<'a> CheckAttrVisitor<'a> {
fn check_inline(&self, attr: &ast::Attribute, target: Target) {
if target != Target::Fn {
span_err!(self.sess, attr.span, E0518, "attribute should be applied to function");
struct_span_err!(self.sess, attr.span, E0518, "attribute should be applied to function")
.span_label(attr.span, &format!("requires a function"))
.emit();
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/test/compile-fail/E0518.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
// except according to those terms.

#[inline(always)] //~ ERROR E0518
//~| requires a function
struct Foo;

#[inline(never)] //~ ERROR E0518
//~| requires a function
impl Foo {
}

Expand Down

0 comments on commit cd56d47

Please sign in to comment.