blob: 68879a0af292a2985fd831ede6f9b3ff6d9490cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
//@ error-pattern: r#T: 'static
//@ error-pattern: r#K: 'static
//@ error-pattern: T: 'static=
// https://github.com/rust-lang/rust/issues/124785
struct Foo<T, K = i32>(&'static T, &'static K);
//~^ ERROR: the parameter type `T` may not live long enough
//~| ERROR: the parameter type `K` may not live long enough
struct Bar<r#T, r#K = i32>(&'static r#T, &'static r#K);
//~^ ERROR: the parameter type `T` may not live long enough
//~| ERROR: the parameter type `K` may not live long enough
struct Boo<T= i32>(&'static T);
//~^ ERROR: the parameter type `T` may not live long enough
struct Far<T
= i32>(&'static T);
//~^ ERROR: the parameter type `T` may not live long enough
struct S<'a, K: 'a = i32>(&'static K);
//~^ ERROR: lifetime parameter `'a` is never used
//~| ERROR: the parameter type `K` may not live long enough
fn main() {}
|