2024-08-31 12:31:31 +00:00
|
|
|
warning: elided lifetime has a name
|
|
|
|
--> $DIR/object-lifetime-default-elision.rs:48:40
|
|
|
|
|
|
|
|
|
LL | fn load2<'a>(ss: &'a dyn SomeTrait) -> &dyn SomeTrait {
|
|
|
|
| -- ^ this elided lifetime gets resolved as `'a`
|
|
|
|
| |
|
|
|
|
| lifetime `'a` declared here
|
|
|
|
|
|
|
|
|
= note: `#[warn(elided_named_lifetimes)]` on by default
|
|
|
|
|
2019-01-27 11:03:21 +00:00
|
|
|
error: lifetime may not live long enough
|
2024-08-31 12:31:31 +00:00
|
|
|
--> $DIR/object-lifetime-default-elision.rs:73:5
|
2019-01-27 11:03:21 +00:00
|
|
|
|
|
2019-05-28 18:46:13 +00:00
|
|
|
LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
|
2019-01-27 11:03:21 +00:00
|
|
|
| -- -- lifetime `'b` defined here
|
|
|
|
| |
|
|
|
|
| lifetime `'a` defined here
|
|
|
|
...
|
|
|
|
LL | ss
|
2021-12-31 21:55:34 +00:00
|
|
|
| ^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
2019-10-27 14:39:14 +00:00
|
|
|
|
|
|
|
|
= help: consider adding the following bound: `'a: 'b`
|
2019-01-27 11:03:21 +00:00
|
|
|
|
2024-08-31 12:31:31 +00:00
|
|
|
error: aborting due to 1 previous error; 1 warning emitted
|
2019-01-27 11:03:21 +00:00
|
|
|
|