2017-10-19 14:32:39 +02:00
|
|
|
// revisions: cfail1 cfail2 cfail3
|
|
|
|
// compile-flags: -Coverflow-checks=on
|
2020-04-19 17:27:28 -07:00
|
|
|
// build-pass
|
2017-10-19 14:32:39 +02:00
|
|
|
|
2020-02-18 22:49:47 +01:00
|
|
|
#![warn(arithmetic_overflow)]
|
2017-10-19 14:32:39 +02:00
|
|
|
|
|
|
|
fn main() {
|
2020-02-15 23:02:58 +01:00
|
|
|
let _ = 255u8 + 1; //~ WARNING operation will overflow
|
2017-10-19 14:32:39 +02:00
|
|
|
}
|