summary refs log tree commit diff
path: root/src/test/run-fail/overflowing-sub.rs
blob: e3b111dd2bba6e0a2beb842b9ba8478442ad30c2 (plain)
1
2
3
4
5
6
7
8
// error-pattern:thread 'main' panicked at 'attempt to subtract with overflow'
// compile-flags: -C debug-assertions

#![allow(const_err)]

fn main() {
    let _x = 42u8 - (42u8 + 1);
}