]>
Commit | Line | Data |
---|---|---|
1b1a35ee XL |
1 | // Checks that const expressions have a useful note explaining why they can't be evaluated. |
2 | // The note should relate to the fact that it cannot be shown forall N that it maps 1-1 to a new | |
3 | // type. | |
4 | ||
5 | // revisions: full min | |
6 | #![cfg_attr(full, feature(const_generics))] | |
7 | #![cfg_attr(full, allow(incomplete_features))] | |
8 | #![cfg_attr(min, feature(min_const_generics))] | |
9 | ||
10 | struct Collatz<const N: Option<usize>>; | |
11 | ||
12 | impl <const N: usize> Collatz<{Some(N)}> {} | |
13 | //~^ ERROR the const parameter | |
29967ef6 | 14 | //[min]~^^ generic parameters may not be used in const operations |
1b1a35ee XL |
15 | |
16 | struct Foo; | |
17 | ||
18 | impl<const N: usize> Foo {} | |
19 | //~^ ERROR the const parameter | |
20 | ||
21 | fn main() {} |