]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/borrowck/borrowck-move-in-irrefut-pat.mir.stderr
Unit test from #57866.
[rust.git] / src / test / ui / borrowck / borrowck-move-in-irrefut-pat.mir.stderr
index f670936dbac17b7a4bee7dac9c2e38d198641daa..c18fce9f4fd5518facc8563990c5401e7a485af2 100644 (file)
@@ -1,31 +1,49 @@
 error[E0507]: cannot move out of borrowed content
-  --> $DIR/borrowck-move-in-irrefut-pat.rs:16:13
+  --> $DIR/borrowck-move-in-irrefut-pat.rs:6:13
    |
 LL | fn arg_item(&_x: &String) {}
    |             ^--
    |             ||
    |             |data moved here
-   |             |help: to prevent move, use ref or ref mut: `ref _x`
    |             cannot move out of borrowed content
+   |             help: consider removing the `&`: `_x`
+   |
+note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-move-in-irrefut-pat.rs:6:14
+   |
+LL | fn arg_item(&_x: &String) {}
+   |              ^^
 
 error[E0507]: cannot move out of borrowed content
-  --> $DIR/borrowck-move-in-irrefut-pat.rs:21:11
+  --> $DIR/borrowck-move-in-irrefut-pat.rs:11:11
    |
 LL |     with(|&_x| ())
    |           ^--
    |           ||
    |           |data moved here
-   |           |help: to prevent move, use ref or ref mut: `ref _x`
    |           cannot move out of borrowed content
+   |           help: consider removing the `&`: `_x`
+   |
+note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-move-in-irrefut-pat.rs:11:12
+   |
+LL |     with(|&_x| ())
+   |            ^^
 
 error[E0507]: cannot move out of borrowed content
-  --> $DIR/borrowck-move-in-irrefut-pat.rs:27:15
+  --> $DIR/borrowck-move-in-irrefut-pat.rs:17:15
+   |
+LL |     let &_x = &"hi".to_string();
+   |         ---   ^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
+   |         ||
+   |         |data moved here
+   |         help: consider removing the `&`: `_x`
+   |
+note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-move-in-irrefut-pat.rs:17:10
    |
 LL |     let &_x = &"hi".to_string();
-   |          --   ^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
-   |          |
-   |          data moved here
-   |          help: to prevent move, use ref or ref mut: `ref _x`
+   |          ^^
 
 error: aborting due to 3 previous errors