浏览代码

Use unreachable_unchecked

Aaron Kutch 4 年之前
父节点
当前提交
bc0646543e
共有 1 个文件被更改,包括 1 次插入3 次删除
  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
 /// 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.
 /// `core/std::unchecked_div/rem` are directly used without a zero check in front.
 fn zero_div_fn() -> ! {
 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
 // The `B` extension on RISC-V determines if a CLZ assembly instruction exists