Skip to content

Commit 5d2caef

Browse files
committed
also test div-by-minus-1
1 parent 4b6a0d7 commit 5d2caef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/compile-fail/unchecked_div1.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![feature(core_intrinsics)]
2+
fn main() {
3+
// MIN/-1 cannot be represented
4+
unsafe { std::intrinsics::unchecked_div(i16::min_value(), -1); } //~ ERROR Overflow executing `unchecked_div`
5+
}

0 commit comments

Comments
 (0)