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