1
Fork 0

E0518 Update error format #36111

- Fixes #36111
- Part of #35233
This commit is contained in:
Gavin Baker 2016-08-30 11:44:25 +10:00
parent 8bcd6a33be
commit cd56d47da3
2 changed files with 5 additions and 1 deletions

View file

@ -42,7 +42,9 @@ struct CheckAttrVisitor<'a> {
impl<'a> CheckAttrVisitor<'a> { impl<'a> CheckAttrVisitor<'a> {
fn check_inline(&self, attr: &ast::Attribute, target: Target) { fn check_inline(&self, attr: &ast::Attribute, target: Target) {
if target != Target::Fn { 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();
} }
} }

View file

@ -9,9 +9,11 @@
// except according to those terms. // except according to those terms.
#[inline(always)] //~ ERROR E0518 #[inline(always)] //~ ERROR E0518
//~| requires a function
struct Foo; struct Foo;
#[inline(never)] //~ ERROR E0518 #[inline(never)] //~ ERROR E0518
//~| requires a function
impl Foo { impl Foo {
} }