]> git.proxmox.com Git - rustc.git/blame - tests/ui/suggestions/ref-pattern-binding.stderr
New upstream version 1.69.0+dfsg1
[rustc.git] / tests / ui / suggestions / ref-pattern-binding.stderr
CommitLineData
487cf647
FG
1error: borrow of moved value
2 --> $DIR/ref-pattern-binding.rs:10:9
3 |
4LL | 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 |
11help: borrow this binding in the pattern to avoid moving the value
12 |
13LL | let ref _moved @ ref _from = String::from("foo");
14 | +++
15
16error: cannot move out of value because it is borrowed
17 --> $DIR/ref-pattern-binding.rs:11:9
18 |
19LL | let ref _moved @ _from = String::from("foo");
20 | ----------^^^-----
21 | | |
9ffffee4
FG
22 | | value is moved into `_from` here
23 | value is borrowed by `_moved` here
487cf647
FG
24
25error: cannot move out of value because it is borrowed
26 --> $DIR/ref-pattern-binding.rs:15:9
27 |
28LL | let ref _moved @ S { f } = S { f: String::from("foo") };
29 | ----------^^^^^^^-^^
30 | | |
9ffffee4
FG
31 | | value is moved into `f` here
32 | value is borrowed by `_moved` here
487cf647
FG
33
34error: borrow of moved value
35 --> $DIR/ref-pattern-binding.rs:18:9
36 |
37LL | 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 |
44help: borrow this binding in the pattern to avoid moving the value
45 |
46LL | let ref _moved @ S { ref f } = S { f: String::from("foo") };
47 | +++
48
49error[E0382]: use of moved value
50 --> $DIR/ref-pattern-binding.rs:9:9
51 |
52LL | 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 |
58help: borrow this binding in the pattern to avoid moving the value
59 |
60LL | let ref _moved @ ref _from = String::from("foo");
61 | +++ +++
62
63error[E0382]: borrow of moved value
64 --> $DIR/ref-pattern-binding.rs:11:9
65 |
66LL | 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 |
72help: borrow this binding in the pattern to avoid moving the value
73 |
74LL | let ref _moved @ ref _from = String::from("foo");
75 | +++
76
77error[E0382]: use of partially moved value
78 --> $DIR/ref-pattern-binding.rs:14:9
79 |
80LL | 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
86help: borrow this binding in the pattern to avoid moving the value
87 |
88LL | let ref _moved @ S { ref f } = S { f: String::from("foo") };
89 | +++ +++
90
91error[E0382]: borrow of partially moved value
92 --> $DIR/ref-pattern-binding.rs:15:9
93 |
94LL | 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
100help: borrow this binding in the pattern to avoid moving the value
101 |
102LL | let ref _moved @ S { ref f } = S { f: String::from("foo") };
103 | +++
104
105error: aborting due to 8 previous errors
106
107For more information about this error, try `rustc --explain E0382`.