]> git.lizzy.rs Git - rust.git/blob - src/test/run-make/coverage/inline-dead.rs
Rollup merge of #99736 - lopopolo:lopopolo/gh-80996-partial-stabilization-bounds...
[rust.git] / src / test / run-make / coverage / inline-dead.rs
1 // Regression test for issue #98833.
2 // compile-flags: -Zinline-mir -Cdebug-assertions=off
3
4 fn main() {
5     println!("{}", live::<false>());
6
7     let f = |x: bool| {
8         debug_assert!(
9             x
10         );
11     };
12     f(false);
13 }
14
15 #[inline]
16 fn live<const B: bool>() -> u32 {
17     if B {
18         dead()
19     } else {
20         0
21     }
22 }
23
24 #[inline]
25 fn dead() -> u32 {
26     42
27 }