]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr
Rollup merge of #94019 - hermitcore:target, r=Mark-Simulacrum
[rust.git] / src / test / ui / generic-associated-types / projection-type-lifetime-mismatch.stderr
1 error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
2   --> $DIR/projection-type-lifetime-mismatch.rs:17:7
3    |
4 LL | fn f(x: &impl for<'a> X<Y<'a> = &'a ()>) -> &'static () {
5    |         ------------------------------- this data with an anonymous lifetime `'_`...
6 LL |     x.m()
7    |     - ^
8    |     |
9    |     ...is used and required to live as long as `'static` here
10
11 error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
12   --> $DIR/projection-type-lifetime-mismatch.rs:22:7
13    |
14 LL | fn g<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &'static () {
15    |                                       -- this data with an anonymous lifetime `'_`...
16 LL |     x.m()
17    |     - ^
18    |     |
19    |     ...is used and required to live as long as `'static` here
20
21 error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
22   --> $DIR/projection-type-lifetime-mismatch.rs:27:7
23    |
24 LL | fn h(x: &()) -> &'static () {
25    |         --- this data with an anonymous lifetime `'_`...
26 LL |     x.m()
27    |     - ^
28    |     |
29    |     ...is used and required to live as long as `'static` here
30
31 error: aborting due to 3 previous errors
32
33 For more information about this error, try `rustc --explain E0759`.