1 error[E0623]: lifetime mismatch
2 --> $DIR/object-lifetime-default-mybox.rs:37:5
4 LL | fn load1<'a,'b>(a: &'a MyBox<SomeTrait>,
5 | -------------------- this parameter and the return type are declared with different lifetimes...
6 LL | b: &'b MyBox<SomeTrait>)
7 LL | -> &'b MyBox<SomeTrait>
10 LL | a //~ ERROR lifetime mismatch
11 | ^ ...but data from `a` is returned here
13 error[E0308]: mismatched types
14 --> $DIR/object-lifetime-default-mybox.rs:41:11
16 LL | load0(ss) //~ ERROR mismatched types
17 | ^^ lifetime mismatch
19 = note: expected type `&MyBox<(dyn SomeTrait + 'static)>`
20 found type `&MyBox<(dyn SomeTrait + 'a)>`
21 note: the lifetime 'a as defined on the function body at 40:10...
22 --> $DIR/object-lifetime-default-mybox.rs:40:10
24 LL | fn load2<'a>(ss: &MyBox<SomeTrait+'a>) -> MyBox<SomeTrait+'a> {
26 = note: ...does not necessarily outlive the static lifetime
28 error: aborting due to 2 previous errors
30 Some errors occurred: E0308, E0623.
31 For more information about an error, try `rustc --explain E0308`.