]>
Commit | Line | Data |
---|---|---|
487cf647 FG |
1 | error: borrow of moved value |
2 | --> $DIR/ref-pattern-binding.rs:10:9 | |
3 | | | |
4 | LL | let _moved @ ref _from = String::from("foo"); | |
353b0b11 FG |
5 | | ^^^^^^ --------- value borrowed here after move |
6 | | | | |
487cf647 FG |
7 | | value moved into `_moved` here |
8 | | move occurs because `_moved` has type `String` which does not implement the `Copy` trait | |
9 | | | |
10 | help: borrow this binding in the pattern to avoid moving the value | |
11 | | | |
12 | LL | let ref _moved @ ref _from = String::from("foo"); | |
13 | | +++ | |
14 | ||
15 | error: cannot move out of value because it is borrowed | |
16 | --> $DIR/ref-pattern-binding.rs:11:9 | |
17 | | | |
18 | LL | let ref _moved @ _from = String::from("foo"); | |
353b0b11 FG |
19 | | ^^^^^^^^^^ ----- value is moved into `_from` here |
20 | | | | |
9ffffee4 | 21 | | value is borrowed by `_moved` here |
487cf647 FG |
22 | |
23 | error: cannot move out of value because it is borrowed | |
24 | --> $DIR/ref-pattern-binding.rs:15:9 | |
25 | | | |
26 | LL | let ref _moved @ S { f } = S { f: String::from("foo") }; | |
353b0b11 FG |
27 | | ^^^^^^^^^^ - value is moved into `f` here |
28 | | | | |
9ffffee4 | 29 | | value is borrowed by `_moved` here |
487cf647 FG |
30 | |
31 | error: borrow of moved value | |
32 | --> $DIR/ref-pattern-binding.rs:18:9 | |
33 | | | |
34 | LL | let _moved @ S { ref f } = S { f: String::from("foo") }; | |
353b0b11 FG |
35 | | ^^^^^^ ----- value borrowed here after move |
36 | | | | |
487cf647 FG |
37 | | value moved into `_moved` here |
38 | | move occurs because `_moved` has type `S` which does not implement the `Copy` trait | |
39 | | | |
40 | help: borrow this binding in the pattern to avoid moving the value | |
41 | | | |
42 | LL | let ref _moved @ S { ref f } = S { f: String::from("foo") }; | |
43 | | +++ | |
44 | ||
45 | error[E0382]: use of moved value | |
46 | --> $DIR/ref-pattern-binding.rs:9:9 | |
47 | | | |
48 | LL | let _moved @ _from = String::from("foo"); | |
49 | | ^^^^^^ ----- ------------------- move occurs because value has type `String`, which does not implement the `Copy` trait | |
50 | | | | | |
51 | | | value moved here | |
52 | | value used here after move | |
53 | | | |
54 | help: borrow this binding in the pattern to avoid moving the value | |
55 | | | |
56 | LL | let ref _moved @ ref _from = String::from("foo"); | |
57 | | +++ +++ | |
58 | ||
59 | error[E0382]: borrow of moved value | |
60 | --> $DIR/ref-pattern-binding.rs:11:9 | |
61 | | | |
62 | LL | let ref _moved @ _from = String::from("foo"); | |
63 | | ^^^^^^^^^^ ----- ------------------- move occurs because value has type `String`, which does not implement the `Copy` trait | |
64 | | | | | |
65 | | | value moved here | |
66 | | value borrowed here after move | |
67 | | | |
68 | help: borrow this binding in the pattern to avoid moving the value | |
69 | | | |
70 | LL | let ref _moved @ ref _from = String::from("foo"); | |
71 | | +++ | |
72 | ||
73 | error[E0382]: use of partially moved value | |
74 | --> $DIR/ref-pattern-binding.rs:14:9 | |
75 | | | |
76 | LL | let _moved @ S { f } = S { f: String::from("foo") }; | |
77 | | ^^^^^^ - value partially moved here | |
78 | | | | |
79 | | value used here after partial move | |
80 | | | |
81 | = note: partial move occurs because value has type `String`, which does not implement the `Copy` trait | |
82 | help: borrow this binding in the pattern to avoid moving the value | |
83 | | | |
84 | LL | let ref _moved @ S { ref f } = S { f: String::from("foo") }; | |
85 | | +++ +++ | |
86 | ||
87 | error[E0382]: borrow of partially moved value | |
88 | --> $DIR/ref-pattern-binding.rs:15:9 | |
89 | | | |
90 | LL | let ref _moved @ S { f } = S { f: String::from("foo") }; | |
91 | | ^^^^^^^^^^ - value partially moved here | |
92 | | | | |
93 | | value borrowed here after partial move | |
94 | | | |
95 | = note: partial move occurs because value has type `String`, which does not implement the `Copy` trait | |
96 | help: borrow this binding in the pattern to avoid moving the value | |
97 | | | |
98 | LL | let ref _moved @ S { ref f } = S { f: String::from("foo") }; | |
99 | | +++ | |
100 | ||
101 | error: aborting due to 8 previous errors | |
102 | ||
103 | For more information about this error, try `rustc --explain E0382`. |