]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/object-lifetime/object-lifetime-default-from-box-error.nll.stderr
Update tests for changes to cannot move errors
[rust.git] / src / test / ui / object-lifetime / object-lifetime-default-from-box-error.nll.stderr
index 9e68647214c277e939417ea3ba34235c32596155..f6252f4ed79771d60b455f2fb73375477ca1bc10 100644 (file)
@@ -1,22 +1,22 @@
 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;