summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/const_goto_const_eval_fail.rs
blob: 3b85fe6ab3cd9722ea65d612ffda97e50e86e04b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![feature(min_const_generics)]
#![crate_type = "lib"]

// If const eval fails, then don't crash
// EMIT_MIR const_goto_const_eval_fail.f.ConstGoto.diff
pub fn f<const A: i32, const B: bool>() -> u64 {
    match {
        match A {
            1 | 2 | 3 => B,
            _ => true,
        }
    } {
        false => 1,
        true => 2,
    }
}