2024-02-16 20:02:50 +00:00
|
|
|
//@ run-fail
|
|
|
|
//@ error-pattern:attempt to negate with overflow
|
|
|
|
//@ ignore-emscripten no processes
|
|
|
|
//@ compile-flags: -C debug-assertions
|
2022-09-27 11:40:39 +09:00
|
|
|
#![allow(arithmetic_overflow)]
|
|
|
|
|
2024-02-22 14:59:52 +01:00
|
|
|
use std::num::NonZero;
|
2022-09-27 11:40:39 +09:00
|
|
|
|
|
|
|
fn main() {
|
2024-02-22 14:59:52 +01:00
|
|
|
let _x = -NonZero::new(i8::MIN).unwrap();
|
2022-09-27 11:40:39 +09:00
|
|
|
}
|