Skip to content

Commit df6e6a6

Browse files
committed
fix #115348
1 parent 51a9df8 commit df6e6a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_mir_transform/src/check_unsafety.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ fn unsafety_check_result(tcx: TyCtxt<'_>, def: LocalDefId) -> &UnsafetyCheckResu
483483
// `mir_built` force this.
484484
let body = &tcx.mir_built(def).borrow();
485485

486-
if body.is_custom_mir() {
486+
if body.is_custom_mir() || body.tainted_by_errors.is_some() {
487487
return tcx.arena.alloc(UnsafetyCheckResult {
488488
violations: Vec::new(),
489489
used_unsafe_blocks: Default::default(),

0 commit comments

Comments
 (0)