2018-12-11 15:49:40 -06:00
|
|
|
error: lifetime may not live long enough
|
2022-04-01 13:13:25 -04:00
|
|
|
--> $DIR/mir_check_cast_closure.rs:5:5
|
2018-07-26 08:21:35 +03:00
|
|
|
|
|
2018-08-02 12:00:15 +02:00
|
|
|
LL | fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 {
|
|
|
|
| -- -- lifetime `'b` defined here
|
|
|
|
| |
|
|
|
|
| lifetime `'a` defined here
|
2018-07-26 08:21:35 +03:00
|
|
|
LL | let g: fn(_, _) -> _ = |_x, y| y;
|
2018-08-07 21:48:50 +01:00
|
|
|
LL | g
|
2021-12-31 16:55:34 -05:00
|
|
|
| ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
2018-11-28 15:05:36 -06:00
|
|
|
|
|
2019-10-27 09:39:14 -05:00
|
|
|
= help: consider adding the following bound: `'b: 'a`
|
2018-11-28 15:05:36 -06:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2018-07-26 08:21:35 +03:00
|
|
|
|