]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs
Update tests to remove old numeric constants
[rust.git] / src / test / ui / const-generics / issues / 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(const_generics))]
5 #![cfg_attr(full, allow(incomplete_features))]
6 #![cfg_attr(min, feature(min_const_generics))]
7
8 struct Arr<const N: usize>
9 where Assert::<{N < usize::MAX / 2}>: IsTrue,
10 //[full]~^ ERROR constant expression depends on a generic parameter
11 //[min]~^^ ERROR generic parameters may not be used in const operations
12 {
13 }
14
15 enum Assert<const CHECK: bool> {}
16
17 trait IsTrue {}
18
19 impl IsTrue for Assert<true> {}
20
21 fn main() {
22     let x: Arr<{usize::MAX}> = Arr {};
23 }