Scope no_mangle and export_name warnings to the declarations name
This commit is contained in:
parent
66b2f9acfc
commit
79b0ab5195
2 changed files with 20 additions and 20 deletions
|
@ -279,12 +279,12 @@ impl EarlyLintPass for UnsafeCode {
|
|||
|
||||
ast::ItemKind::Fn(..) => {
|
||||
if attr::contains_name(&it.attrs, sym::no_mangle) {
|
||||
self.report_unsafe(cx, it.span, |lint| {
|
||||
self.report_unsafe(cx, it.ident.span, |lint| {
|
||||
lint.build("declaration of a `no_mangle` function").emit();
|
||||
})
|
||||
}
|
||||
if attr::contains_name(&it.attrs, sym::export_name) {
|
||||
self.report_unsafe(cx, it.span, |lint| {
|
||||
self.report_unsafe(cx, it.ident.span, |lint| {
|
||||
lint.build("declaration of a function with `export_name`").emit();
|
||||
})
|
||||
}
|
||||
|
@ -292,12 +292,12 @@ impl EarlyLintPass for UnsafeCode {
|
|||
|
||||
ast::ItemKind::Static(..) => {
|
||||
if attr::contains_name(&it.attrs, sym::no_mangle) {
|
||||
self.report_unsafe(cx, it.span, |lint| {
|
||||
self.report_unsafe(cx, it.ident.span, |lint| {
|
||||
lint.build("declaration of a `no_mangle` static").emit();
|
||||
})
|
||||
}
|
||||
if attr::contains_name(&it.attrs, sym::export_name) {
|
||||
self.report_unsafe(cx, it.span, |lint| {
|
||||
self.report_unsafe(cx, it.ident.span, |lint| {
|
||||
lint.build("declaration of a static with `export_name`").emit();
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue