]> git.proxmox.com Git - rustc.git/blame - tests/ui/lifetimes/unusual-rib-combinations.rs
New upstream version 1.69.0+dfsg1
[rustc.git] / tests / ui / lifetimes / unusual-rib-combinations.rs
CommitLineData
2b03887a
FG
1#![feature(inline_const)]
2
3struct S<'a>(&'a u8);
4fn foo() {}
5
6// Paren generic args in AnonConst
7fn 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
14fn b<const C: u8()>() {}
15//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
16
17// Paren generic args in AnonymousReportError
18fn 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
24fn d<const C: S>() {}
25//~^ ERROR missing lifetime specifier
9ffffee4 26//~| ERROR `S<'_>` is forbidden as the type of a const generic parameter
2b03887a
FG
27
28fn main() {}