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:
Nilstrieb 2024-02-20 15:13:55 +01:00 committed by GitHub
commit d61adbffe1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 59 additions and 4 deletions

View file

@ -393,6 +393,10 @@ impl EarlyLintPass for UnsafeCode {
}
}
ast::ItemKind::GlobalAsm(..) => {
self.report_unsafe(cx, it.span, BuiltinUnsafe::GlobalAsm);
}
_ => {}
}
}