parent
8bcd6a33be
commit
cd56d47da3
2 changed files with 5 additions and 1 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue