error[E0621]: explicit lifetime required in the type of `ss`
--> $DIR/object-lifetime-default-from-box-error.rs:18:5
|
-LL | fn load(ss: &mut SomeStruct) -> Box<SomeTrait> {
+LL | fn load(ss: &mut SomeStruct) -> Box<dyn SomeTrait> {
| --------------- help: add explicit lifetime `'static` to the type of `ss`: `&mut SomeStruct<'static>`
...
LL | ss.r
| ^^^^ lifetime `'static` required
-error[E0507]: cannot move out of borrowed content
+error[E0507]: cannot move out of `ss.r` which is behind a mutable reference
--> $DIR/object-lifetime-default-from-box-error.rs:18:5
|
LL | ss.r
- | ^^^^ cannot move out of borrowed content
+ | ^^^^ move occurs because `ss.r` has type `std::boxed::Box<dyn SomeTrait>`, which does not implement the `Copy` trait
error[E0621]: explicit lifetime required in the type of `ss`
--> $DIR/object-lifetime-default-from-box-error.rs:31:5
|
-LL | fn store1<'b>(ss: &mut SomeStruct, b: Box<SomeTrait+'b>) {
+LL | fn store1<'b>(ss: &mut SomeStruct, b: Box<dyn SomeTrait+'b>) {
| --------------- help: add explicit lifetime `'b` to the type of `ss`: `&mut SomeStruct<'b>`
...
LL | ss.r = b;