]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.rs
Move generic error message to separate branches
[rust.git] / src / test / ui / const-generics / generic_const_exprs / issue-72819-generic-in-const-eval.rs
1 // Regression test for #72819: ICE due to failure in resolving the const generic in `Arr`'s type
2 // bounds.
3 // revisions: full min
4 #![cfg_attr(full, feature(generic_const_exprs))]
5 #![cfg_attr(full, allow(incomplete_features))]
6
7 struct Arr<const N: usize>
8 where Assert::<{N < usize::MAX / 2}>: IsTrue,
9 //[min]~^ ERROR generic parameters may not be used in const operations
10 {
11 }
12
13 enum Assert<const CHECK: bool> {}
14
15 trait IsTrue {}
16
17 impl IsTrue for Assert<true> {}
18
19 fn main() {
20     let x: Arr<{usize::MAX}> = Arr {};
21     //[full]~^ ERROR mismatched types
22     //[full]~| ERROR mismatched types
23 }