2020-09-10 19:43:53 +02:00
|
|
|
// compile-flags: -Zsave-analysis
|
|
|
|
|
|
|
|
|
|
#![feature(const_generics)]
|
|
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
struct Arr<const N: usize>
|
2020-10-24 19:21:40 -04:00
|
|
|
where Assert::<{N < usize::MAX / 2}>: IsTrue, //~ ERROR constant expression
|
2020-09-10 19:43:53 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum Assert<const CHECK: bool> {}
|
|
|
|
|
|
|
|
|
|
trait IsTrue {}
|
|
|
|
|
|
|
|
|
|
impl IsTrue for Assert<true> {}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
2020-10-24 19:21:40 -04:00
|
|
|
let x: Arr<{usize::MAX}> = Arr {};
|
2020-09-10 19:43:53 +02:00
|
|
|
//~^ ERROR mismatched types
|
|
|
|
|
//~| ERROR mismatched types
|
|
|
|
|
}
|