mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
16 lines
264 B
Rust
16 lines
264 B
Rust
// build-pass
|
|
// compile-flags: -Zmir-opt-level=3
|
|
// Overflow can't be detected by const prop
|
|
// could only be detected after optimizations
|
|
|
|
#![deny(warnings)]
|
|
|
|
fn main() {
|
|
let _ = add(u8::MAX, 1);
|
|
}
|
|
|
|
#[inline(always)]
|
|
fn add(x: u8, y: u8) -> u8 {
|
|
x + y
|
|
}
|