]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/const_goto_const_eval_fail.rs
Add #[const_trait] where needed in tests.
[rust.git] / src / test / mir-opt / const_goto_const_eval_fail.rs
1 #![feature(min_const_generics)]
2 #![crate_type = "lib"]
3
4 // If const eval fails, then don't crash
5 // EMIT_MIR const_goto_const_eval_fail.f.ConstGoto.diff
6 pub fn f<const A: i32, const B: bool>() -> u64 {
7     match {
8         match A {
9             1 | 2 | 3 => B,
10             _ => true,
11         }
12     } {
13         false => 1,
14         true => 2,
15     }
16 }