Sfoglia il codice sorgente

Use unreachable_unchecked

Aaron Kutch 4 anni fa
parent
commit
bc0646543e
1 ha cambiato i file con 1 aggiunte e 3 eliminazioni
  1. 1 3
      src/int/specialized_div_rem/mod.rs

+ 1 - 3
src/int/specialized_div_rem/mod.rs

@@ -57,9 +57,7 @@ mod asymmetric;
 /// impossible to reach by Rust users, unless `compiler-builtins` public division functions or
 /// `core/std::unchecked_div/rem` are directly used without a zero check in front.
 fn zero_div_fn() -> ! {
-    // TODO: change this once the algorithms are verified
-    //unsafe {core::hint::unreachable_unchecked()}
-    ::abort()
+    unsafe { core::hint::unreachable_unchecked() }
 }
 
 // The `B` extension on RISC-V determines if a CLZ assembly instruction exists