also test div-by-minus-1
This commit is contained in:
parent
4b6a0d7a8e
commit
5d2caef3ce
1 changed files with 5 additions and 0 deletions
5
tests/compile-fail/unchecked_div1.rs
Normal file
5
tests/compile-fail/unchecked_div1.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#![feature(core_intrinsics)]
|
||||
fn main() {
|
||||
// MIN/-1 cannot be represented
|
||||
unsafe { std::intrinsics::unchecked_div(i16::min_value(), -1); } //~ ERROR Overflow executing `unchecked_div`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue