2020-06-08 19:46:28 -05:00
|
|
|
// Regression test for #72819: ICE due to failure in resolving the const generic in `Arr`'s type
|
|
|
|
// bounds.
|
|
|
|
|
2020-06-06 13:44:28 -05:00
|
|
|
#![feature(const_generics)]
|
|
|
|
#![allow(incomplete_features)]
|
|
|
|
struct Arr<const N: usize>
|
2020-06-06 14:00:23 -05:00
|
|
|
where Assert::<{N < usize::max_value() / 2}>: IsTrue,
|
|
|
|
//~^ ERROR constant expression depends on a generic parameter
|
2020-06-06 13:44:28 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
enum Assert<const CHECK: bool> {}
|
|
|
|
|
|
|
|
trait IsTrue {}
|
|
|
|
|
|
|
|
impl IsTrue for Assert<true> {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x: Arr<{usize::max_value()}> = Arr {};
|
|
|
|
}
|