2020-12-30 02:04:52 +00:00
|
|
|
// Must be build-pass, because check-pass will not run const prop and thus not emit the lint anyway.
|
|
|
|
//@ build-pass
|
2021-03-04 10:35:11 -03:00
|
|
|
//@ compile-flags: -Zmir-opt-level=3
|
2020-12-30 02:04:52 +00:00
|
|
|
|
|
|
|
#![deny(warnings)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
#[allow(arithmetic_overflow)]
|
|
|
|
let _ = add(u8::MAX, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[inline(always)]
|
|
|
|
fn add(x: u8, y: u8) -> u8 {
|
|
|
|
x + y
|
|
|
|
}
|