]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/issues/issue-73260.rs
Auto merge of #76885 - dylni:move-slice-check-range-to-range-bounds, r=KodrAus
[rust.git] / src / test / ui / const-generics / issues / issue-73260.rs
1 // compile-flags: -Zsave-analysis
2
3 #![feature(const_generics)]
4 #![allow(incomplete_features)]
5 struct Arr<const N: usize>
6 where Assert::<{N < usize::max_value() / 2}>: IsTrue, //~ ERROR constant expression
7 {
8 }
9
10 enum Assert<const CHECK: bool> {}
11
12 trait IsTrue {}
13
14 impl IsTrue for Assert<true> {}
15
16 fn main() {
17     let x: Arr<{usize::max_value()}> = Arr {};
18     //~^ ERROR mismatched types
19     //~| ERROR mismatched types
20 }