Fire unsafe_code lint on unsafe extern blocks
This commit is contained in:
parent
c3774be741
commit
a3ef94e80e
5 changed files with 41 additions and 0 deletions
|
@ -326,6 +326,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