]>
Commit | Line | Data |
---|---|---|
1b1a35ee XL |
1 | // revisions: full min |
2 | #![cfg_attr(full, feature(const_generics))] | |
3 | #![cfg_attr(full, allow(incomplete_features))] | |
4 | #![cfg_attr(min, feature(min_const_generics))] | |
f9f354fc XL |
5 | |
6 | trait Foo {} | |
7 | ||
8 | impl<const N: usize> Foo for [(); N] | |
9 | where | |
10 | Self:FooImpl<{N==0}> | |
1b1a35ee | 11 | //[full]~^ERROR constant expression depends on a generic parameter |
29967ef6 | 12 | //[min]~^^ERROR generic parameters may not be used in const operations |
f9f354fc XL |
13 | {} |
14 | ||
15 | trait FooImpl<const IS_ZERO: bool>{} | |
16 | ||
17 | impl FooImpl<true> for [(); 0] {} | |
18 | ||
19 | impl<const N:usize> FooImpl<false> for [();N] {} | |
20 | ||
21 | fn foo(_: impl Foo) {} | |
22 | ||
23 | fn main() { | |
24 | foo([]); | |
25 | foo([()]); | |
26 | } |