2023-09-04 10:35:51 -05:00
|
|
|
error: lifetime may not live long enough
|
|
|
|
--> $DIR/wf-fn-def-check-sig-2.rs:11:5
|
|
|
|
|
|
|
|
|
LL | fn extend_lifetime<'a, 'b, T: ?Sized>(x: &'a T) -> &'b T {
|
|
|
|
| -- -- lifetime `'b` defined here
|
|
|
|
| |
|
|
|
|
| lifetime `'a` defined here
|
|
|
|
LL | let f = foo;
|
|
|
|
LL | f.baz(x)
|
|
|
|
| ^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
|
|
|
|
|
|
|
|
= help: consider adding the following bound: `'a: 'b`
|
|
|
|
|
2024-04-03 20:14:52 -05:00
|
|
|
error: aborting due to 1 previous error
|
2023-09-04 10:35:51 -05:00
|
|
|
|