2022-07-02 19:00:00 -05:00
|
|
|
1| |// Regression test for issue #98833.
|
2022-07-24 19:00:00 -05:00
|
|
|
2| |// compile-flags: -Zinline-mir -Cdebug-assertions=off
|
2022-07-02 19:00:00 -05:00
|
|
|
3| |
|
|
|
|
4| 1|fn main() {
|
|
|
|
5| 1| println!("{}", live::<false>());
|
2022-07-24 19:00:00 -05:00
|
|
|
6| 1|
|
|
|
|
7| 1| let f = |x: bool| {
|
|
|
|
8| | debug_assert!(
|
2022-09-05 08:42:17 -05:00
|
|
|
9| 0| x
|
2022-07-24 19:00:00 -05:00
|
|
|
10| | );
|
|
|
|
11| 1| };
|
|
|
|
12| 1| f(false);
|
|
|
|
13| 1|}
|
|
|
|
14| |
|
|
|
|
15| |#[inline]
|
|
|
|
16| 1|fn live<const B: bool>() -> u32 {
|
|
|
|
17| 1| if B {
|
|
|
|
18| 0| dead()
|
|
|
|
19| | } else {
|
|
|
|
20| 1| 0
|
|
|
|
21| | }
|
|
|
|
22| 1|}
|
|
|
|
23| |
|
|
|
|
24| |#[inline]
|
|
|
|
25| 0|fn dead() -> u32 {
|
|
|
|
26| 0| 42
|
|
|
|
27| 0|}
|
2022-07-02 19:00:00 -05:00
|
|
|
|