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_unsize.rs:6:5
|
2018-07-26 08:21:35 +03:00
|
|
|
|
|
2018-08-25 12:13:28 +01:00
|
|
|
LL | fn bar<'a>(x: &'a u32) -> &'static dyn Debug {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
LL | x
|
2018-09-15 18:30:29 +01:00
|
|
|
| ^ returning this value requires that `'a` must outlive `'static`
|
2022-04-24 16:44:09 +02:00
|
|
|
|
|
|
|
|
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'a` lifetime bound
|
|
|
|
|
|
|
|
|
LL | fn bar<'a>(x: &'a u32) -> &'static dyn Debug + 'a {
|
|
|
|
| ++++
|
2018-11-28 15:05:36 -06:00
|
|
|
|
2018-07-26 08:21:35 +03:00
|
|
|
error: aborting due to previous error
|
|
|
|
|