]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-move-in-irrefut-pat.mir.stderr
Auto merge of #52101 - japaric:linker-flavor, r=alexcrichton
[rust.git] / src / test / ui / borrowck / borrowck-move-in-irrefut-pat.mir.stderr
1 error[E0507]: cannot move out of borrowed content
2   --> $DIR/borrowck-move-in-irrefut-pat.rs:16:13
3    |
4 LL | fn arg_item(&_x: &String) {}
5    |             ^--
6    |             ||
7    |             |data moved here
8    |             cannot move out of borrowed content
9    |             help: consider removing the `&`: `_x`
10    |
11 note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
12   --> $DIR/borrowck-move-in-irrefut-pat.rs:16:14
13    |
14 LL | fn arg_item(&_x: &String) {}
15    |              ^^
16
17 error[E0507]: cannot move out of borrowed content
18   --> $DIR/borrowck-move-in-irrefut-pat.rs:21:11
19    |
20 LL |     with(|&_x| ())
21    |           ^--
22    |           ||
23    |           |data moved here
24    |           cannot move out of borrowed content
25    |           help: consider removing the `&`: `_x`
26    |
27 note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
28   --> $DIR/borrowck-move-in-irrefut-pat.rs:21:12
29    |
30 LL |     with(|&_x| ())
31    |            ^^
32
33 error[E0507]: cannot move out of borrowed content
34   --> $DIR/borrowck-move-in-irrefut-pat.rs:27:15
35    |
36 LL |     let &_x = &"hi".to_string();
37    |         ---   ^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
38    |         ||
39    |         |data moved here
40    |         help: consider removing the `&`: `_x`
41    |
42 note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
43   --> $DIR/borrowck-move-in-irrefut-pat.rs:27:10
44    |
45 LL |     let &_x = &"hi".to_string();
46    |          ^^
47
48 error: aborting due to 3 previous errors
49
50 For more information about this error, try `rustc --explain E0507`.