summaryrefslogtreecommitdiffstats
path: root/tests/ui/const_prop/inline_spans.rs
blob: 504f27811564b50bf4228f3c5ba1a8ef3d59e08f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// 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
}