rust/tests/coverage/inline-dead.rs
Zalathar 448d63e946 Tweak various coverage test files for slightly nicer formatting
For coverage tests, splitting code across multiple lines often makes the
resulting coverage report easier to interpret, so we force rustfmt to retain
line breaks by adding dummy line comments with `//`.
2024-05-29 14:34:11 +10:00

26 lines
360 B
Rust

// 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
}