summary refs log tree commit diff
path: root/src/test/ui/const-generics/issues/issue-73260.rs
blob: 351d6849af5db26a3214e8fc605a6721b53d9537 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// compile-flags: -Zsave-analysis

#![feature(const_generics)]
#![allow(incomplete_features)]
struct Arr<const N: usize>
where Assert::<{N < usize::max_value() / 2}>: IsTrue, //~ ERROR constant expression
{
}

enum Assert<const CHECK: bool> {}

trait IsTrue {}

impl IsTrue for Assert<true> {}

fn main() {
    let x: Arr<{usize::max_value()}> = Arr {};
    //~^ ERROR mismatched types
    //~| ERROR mismatched types
}