1
Fork 0

Fix unused_unsafe with compiler-generated unsafe

This commit is contained in:
Cameron Steffen 2021-04-29 20:54:22 -05:00
parent 39260f6d49
commit b07bb6d698
9 changed files with 43 additions and 25 deletions

View file

@ -321,6 +321,7 @@ impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
}
false
}
Safety::BuiltinUnsafe => true,
Safety::ExplicitUnsafe(hir_id) => {
// mark unsafe block as used if there are any unsafe operations inside
if !violations.is_empty() {