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