Rollup merge of #127535 - spastorino:unsafe_code-unsafe_extern_blocks, r=oli-obk
Fire unsafe_code lint on unsafe extern blocks Fixes #126738
This commit is contained in:
commit
2e0591b1e9
5 changed files with 41 additions and 0 deletions
|
@ -325,6 +325,12 @@ impl EarlyLintPass for UnsafeCode {
|
|||
self.report_unsafe(cx, it.span, BuiltinUnsafe::GlobalAsm);
|
||||
}
|
||||
|
||||
ast::ItemKind::ForeignMod(ForeignMod { safety, .. }) => {
|
||||
if let Safety::Unsafe(_) = safety {
|
||||
self.report_unsafe(cx, it.span, BuiltinUnsafe::UnsafeExternBlock);
|
||||
}
|
||||
}
|
||||
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue