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