]> 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 17fb7c4acdffdac4d471158be880cd4c96feeb85..f6252f4ed79771d60b455f2fb73375477ca1bc10 100644 (file)
@@ -7,11 +7,11 @@ LL | fn load(ss: &mut SomeStruct) -> Box<dyn SomeTrait> {
 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