Rollup merge of #121318 - kadiwa4:no_assembly_in_supposedly_safe_code, r=Nilstrieb
Trigger `unsafe_code` lint on invocations of `global_asm` `unsafe_code` already warns about things that don't involve the `unsafe` keyword, e.g. `#[no_mangle]`. This makes it warn on `core::arch::global_asm` too. Fixes #103078
This commit is contained in:
commit
d61adbffe1
7 changed files with 59 additions and 4 deletions
|
@ -393,6 +393,10 @@ impl EarlyLintPass for UnsafeCode {
|
|||
}
|
||||
}
|
||||
|
||||
ast::ItemKind::GlobalAsm(..) => {
|
||||
self.report_unsafe(cx, it.span, BuiltinUnsafe::GlobalAsm);
|
||||
}
|
||||
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue