Skip to content

Commit 5c58a1b

Browse files
committed
Remove unnecessary recursive call to parent unsafeck
All bodies are unsafe checked anyway. Current MIR unsafeck also just returns for closures.
1 parent adf1717 commit 5c58a1b

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

compiler/rustc_mir_build/src/check_unsafety.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,6 @@ pub fn check_unsafety<'tcx>(tcx: TyCtxt<'tcx>, def: ty::WithOptConstParam<LocalD
627627

628628
// Closures and inline consts are handled by their owner, if it has a body
629629
if tcx.is_typeck_child(def.did.to_def_id()) {
630-
let hir = tcx.hir();
631-
let owner = hir.enclosing_body_owner(hir.local_def_id_to_hir_id(def.did));
632-
tcx.ensure().thir_check_unsafety(owner);
633630
return;
634631
}
635632

0 commit comments

Comments
 (0)