Sign in
rust
/
rust-lang
/
rust
/
HEAD
/
.
/
tests
/
ui
/
numbers-arithmetic
/
overflowing-neg-nonzero.rs
blob: c5059c002b4bf763832224a26a39a6d4c17acb16 [
file
] [
log
] [
blame
]
//@ run-fail
//@ error-pattern:attempt to negate with overflow
//@ needs-subprocess
//@ compile-flags: -C debug-assertions
#![
allow
(
arithmetic_overflow
)]
use
std
::
num
::
NonZero
;
fn
main
()
{
let
_x
=
-
NonZero
::
new
(
i8
::
MIN
).
unwrap
();
}