]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetimes/unusual-rib-combinations.rs
Rollup merge of #105555 - krasimirgg:llvm-int-opt-2, r=cuviper
[rust.git] / src / test / ui / lifetimes / unusual-rib-combinations.rs
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
26 //~| ERROR `S<'static>` is forbidden as the type of a const generic parameter
27
28 fn main() {}