2021-08-27 11:04:57 -05:00
|
|
|
#![feature(generic_const_exprs)]
|
2020-09-10 12:43:53 -05:00
|
|
|
#![allow(incomplete_features)]
|
|
|
|
struct Arr<const N: usize>
|
2021-08-27 11:04:57 -05:00
|
|
|
where
|
|
|
|
Assert::<{N < usize::MAX / 2}>: IsTrue,
|
|
|
|
{}
|
2020-09-10 12:43:53 -05:00
|
|
|
|
|
|
|
enum Assert<const CHECK: bool> {}
|
|
|
|
|
|
|
|
trait IsTrue {}
|
|
|
|
|
|
|
|
impl IsTrue for Assert<true> {}
|
|
|
|
|
|
|
|
fn main() {
|
2020-10-24 18:21:40 -05:00
|
|
|
let x: Arr<{usize::MAX}> = Arr {};
|
2020-09-10 12:43:53 -05:00
|
|
|
//~^ ERROR mismatched types
|
|
|
|
//~| ERROR mismatched types
|
|
|
|
}
|