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-09-09 06:28:41 -05:00
|
|
|
// revisions: full min
|
|
|
|
#![cfg_attr(full, feature(const_generics))]
|
|
|
|
#![cfg_attr(full, allow(incomplete_features))]
|
|
|
|
#![cfg_attr(min, feature(min_const_generics))]
|
2020-06-08 19:46:28 -05:00
|
|
|
|
2020-06-06 13:44:28 -05:00
|
|
|
struct Arr<const N: usize>
|
2020-06-06 14:00:23 -05:00
|
|
|
where Assert::<{N < usize::max_value() / 2}>: IsTrue,
|
2020-09-09 06:28:41 -05:00
|
|
|
//[full]~^ ERROR constant expression depends on a generic parameter
|
2020-10-12 16:27:59 -05:00
|
|
|
//[min]~^^ ERROR generic parameters may not be used in const operations
|
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 {};
|
|
|
|
}
|