Skip to content

Commit a85d17e

Browse files
authored
Merge pull request #496 from RalfJung/unreachable
2 parents 276122f + edc6d76 commit a85d17e

File tree

1 file changed

+4
-1
lines changed
  • src/int/specialized_div_rem

1 file changed

+4
-1
lines changed

src/int/specialized_div_rem/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ mod asymmetric;
7272
/// impossible to reach by Rust users, unless `compiler-builtins` public division functions or
7373
/// `core/std::unchecked_div/rem` are directly used without a zero check in front.
7474
fn zero_div_fn() -> ! {
75-
unsafe { core::hint::unreachable_unchecked() }
75+
// Calling the intrinsic directly, to avoid the `assert_unsafe_precondition` that cannot be used
76+
// here because it involves non-`inline` functions
77+
// (https://github.com/rust-lang/compiler-builtins/issues/491).
78+
unsafe { core::intrinsics::unreachable() }
7679
}
7780

7881
const USE_LZ: bool = {

0 commit comments

Comments
 (0)