fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.4 KiB48 linesraw
1error[E0507]: cannot move out of a shared reference
2  --> $DIR/borrowck-move-in-irrefut-pat.rs:3:13
3   |
4LL | fn arg_item(&_x: &String) {}
5   |             ^--
6   |              |
7   |              data moved here
8   |              move occurs because `_x` has type `String`, which does not implement the `Copy` trait
9   |
10help: consider removing the borrow
11   |
12LL - fn arg_item(&_x: &String) {}
13LL + fn arg_item(_x: &String) {}
14   |
15
16error[E0507]: cannot move out of a shared reference
17  --> $DIR/borrowck-move-in-irrefut-pat.rs:7:11
18   |
19LL |     with(|&_x| ())
20   |           ^--
21   |            |
22   |            data moved here
23   |            move occurs because `_x` has type `String`, which does not implement the `Copy` trait
24   |
25help: consider removing the borrow
26   |
27LL -     with(|&_x| ())
28LL +     with(|_x| ())
29   |
30
31error[E0507]: cannot move out of a shared reference
32  --> $DIR/borrowck-move-in-irrefut-pat.rs:12:15
33   |
34LL |     let &_x = &"hi".to_string();
35   |          --   ^^^^^^^^^^^^^^^^^
36   |          |
37   |          data moved here
38   |          move occurs because `_x` has type `String`, which does not implement the `Copy` trait
39   |
40help: consider removing the borrow
41   |
42LL -     let &_x = &"hi".to_string();
43LL +     let _x = &"hi".to_string();
44   |
45
46error: aborting due to 3 previous errors
47
48For more information about this error, try `rustc --explain E0507`.