summaryrefslogtreecommitdiffstats
path: root/tests/run-coverage/inline-dead.rs
blob: 854fa062967526a5b530b4f68ca7883c1907f73a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Regression test for issue #98833.
// compile-flags: -Zinline-mir -Cdebug-assertions=off

fn main() {
    println!("{}", live::<false>());

    let f = |x: bool| {
        debug_assert!(
            x
        );
    };
    f(false);
}

#[inline]
fn live<const B: bool>() -> u32 {
    if B {
        dead()
    } else {
        0
    }
}

#[inline]
fn dead() -> u32 {
    42
}