Skip to content

Commit c0b972a

Browse files
committed
Return Ok(false) instead of throwing when handling a diverging intrinsic
1 parent 68d9853 commit c0b972a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/librustc_mir/interpret/intrinsics.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
9595
) -> InterpResult<'tcx, bool> {
9696
let substs = instance.substs;
9797

98-
// The intrinsic itself cannot diverge, so if we got here without a return
99-
// place... (can happen e.g., for transmute returning `!`)
98+
// We currently do not handle any diverging intrinsics.
10099
let dest = match dest {
101100
Some(dest) => dest,
102-
None => throw_ub!(Unreachable)
101+
None => return Ok(false)
103102
};
104103
let intrinsic_name = &*self.tcx.item_name(instance.def_id()).as_str();
105104

0 commit comments

Comments
 (0)