]>
Commit | Line | Data |
---|---|---|
2b03887a FG |
1 | #![feature(inline_const)] |
2 | ||
3 | struct S<'a>(&'a u8); | |
4 | fn foo() {} | |
5 | ||
6 | // Paren generic args in AnonConst | |
7 | fn a() -> [u8; foo::()] { | |
8 | //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait | |
9 | //~| ERROR mismatched types | |
10 | panic!() | |
11 | } | |
12 | ||
13 | // Paren generic args in ConstGeneric | |
14 | fn b<const C: u8()>() {} | |
15 | //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait | |
16 | ||
17 | // Paren generic args in AnonymousReportError | |
18 | fn c<T = u8()>() {} | |
19 | //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait | |
20 | //~| ERROR defaults for type parameters are only allowed in | |
21 | //~| WARN this was previously accepted | |
22 | ||
23 | // Elided lifetime in path in ConstGeneric | |
24 | fn d<const C: S>() {} | |
25 | //~^ ERROR missing lifetime specifier | |
9ffffee4 | 26 | //~| ERROR `S<'_>` is forbidden as the type of a const generic parameter |
2b03887a | 27 | |
353b0b11 FG |
28 | trait Foo<'a> {} |
29 | struct Bar<const N: &'a (dyn for<'a> Foo<'a>)>; | |
30 | //~^ ERROR use of non-static lifetime `'a` in const generic | |
31 | //~| ERROR `&dyn for<'a> Foo<'a>` is forbidden as the type of a const generic parameter | |
32 | ||
2b03887a | 33 | fn main() {} |