]>
Commit | Line | Data |
---|---|---|
1b1a35ee | 1 | // This test checks that non-static lifetimes are prohibited under `min_const_generics`. It |
94222f64 | 2 | // currently emits an error with `min_const_generics`. |
1b1a35ee XL |
3 | |
4 | fn test<const N: usize>() {} | |
5 | ||
6 | fn issue_75323_and_74447_1<'a>() -> &'a () { | |
7 | test::<{ let _: &'a (); 3 },>(); | |
8 | //~^ ERROR a non-static lifetime is not allowed in a `const` | |
9 | &() | |
10 | } | |
11 | ||
12 | fn issue_75323_and_74447_2() { | |
13 | test::<{ let _: &(); 3 },>(); | |
14 | } | |
15 | ||
16 | fn issue_75323_and_74447_3() { | |
17 | test::<{ let _: &'static (); 3 },>(); | |
18 | } | |
19 | ||
20 | fn issue_73375<'a>() { | |
21 | [(); (|_: &'a u8| (), 0).1]; | |
22 | //~^ ERROR a non-static lifetime is not allowed in a `const` | |
23 | } | |
24 | ||
25 | fn main() {} |