rust/src/test/run-fail/overflowing-sub.rs

9 lines
185 B
Rust
Raw Normal View History

// error-pattern:thread 'main' panicked at 'attempt to subtract with overflow'
// compile-flags: -C debug-assertions
2020-02-15 18:02:36 +00:00
#![allow(overflow)]
fn main() {
let _x = 42u8 - (42u8 + 1);
}