about summary refs log tree commit diff
path: root/tests/ui/const_prop/inline_spans_lint_attribute.rs
blob: b6c28922b2278f1675202529f325c52ea91cd804 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Must be build-pass, because check-pass will not run const prop and thus not emit the lint anyway.
//@ build-pass
//@ compile-flags: -Zmir-opt-level=3

#![deny(warnings)]

fn main() {
    #[allow(arithmetic_overflow)]
    let _ = add(u8::MAX, 1);
}

#[inline(always)]
fn add(x: u8, y: u8) -> u8 {
    x + y
}