]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/or-patterns.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / or-patterns.stderr
1 error[E0382]: borrow of moved value: `x.0.0`
2   --> $DIR/or-patterns.rs:8:5
3    |
4 LL |         ((y, _) | (_, y),) => (),
5    |           - value moved here
6 LL |     }
7 LL |     &x.0 .0;
8    |     ^^^^^^^ value borrowed here after move
9    |
10    = note: move occurs because `x.0.0` has type `String`, which does not implement the `Copy` trait
11 help: borrow this binding in the pattern to avoid moving the value
12    |
13 LL |         ((ref y, _) | (_, y),) => (),
14    |           +++
15
16 error[E0382]: borrow of moved value: `x.0.1`
17   --> $DIR/or-patterns.rs:10:5
18    |
19 LL |         ((y, _) | (_, y),) => (),
20    |                       - value moved here
21 ...
22 LL |     &x.0 .1;
23    |     ^^^^^^^ value borrowed here after move
24    |
25    = note: move occurs because `x.0.1` has type `String`, which does not implement the `Copy` trait
26 help: borrow this binding in the pattern to avoid moving the value
27    |
28 LL |         ((y, _) | (_, ref y),) => (),
29    |                       +++
30
31 error[E0502]: cannot borrow `x.0.0` as mutable because it is also borrowed as immutable
32   --> $DIR/or-patterns.rs:18:5
33    |
34 LL |         ((ref y, _) | (_, ref y),) => y,
35    |           ----- immutable borrow occurs here
36 LL |     };
37 LL |     &mut x.0 .0;
38    |     ^^^^^^^^^^^ mutable borrow occurs here
39 ...
40 LL |     drop(r);
41    |          - immutable borrow later used here
42
43 error[E0502]: cannot borrow `x.0.1` as mutable because it is also borrowed as immutable
44   --> $DIR/or-patterns.rs:20:5
45    |
46 LL |         ((ref y, _) | (_, ref y),) => y,
47    |                           ----- immutable borrow occurs here
48 ...
49 LL |     &mut x.0 .1;
50    |     ^^^^^^^^^^^ mutable borrow occurs here
51 LL |
52 LL |     drop(r);
53    |          - immutable borrow later used here
54
55 error[E0502]: cannot borrow `x.0.0` as immutable because it is also borrowed as mutable
56   --> $DIR/or-patterns.rs:29:5
57    |
58 LL |         ((ref mut y, _) | (_, ref mut y),) => y,
59    |           --------- mutable borrow occurs here
60 LL |     };
61 LL |     &x.0 .0;
62    |     ^^^^^^^ immutable borrow occurs here
63 ...
64 LL |     drop(r);
65    |          - mutable borrow later used here
66
67 error[E0502]: cannot borrow `x.0.1` as immutable because it is also borrowed as mutable
68   --> $DIR/or-patterns.rs:31:5
69    |
70 LL |         ((ref mut y, _) | (_, ref mut y),) => y,
71    |                               --------- mutable borrow occurs here
72 ...
73 LL |     &x.0 .1;
74    |     ^^^^^^^ immutable borrow occurs here
75 LL |
76 LL |     drop(r);
77    |          - mutable borrow later used here
78
79 error[E0382]: borrow of moved value: `x.0.0`
80   --> $DIR/or-patterns.rs:38:5
81    |
82 LL |     let ((y, _) | (_, y),) = x;
83    |           - value moved here
84 LL |     &x.0 .0;
85    |     ^^^^^^^ value borrowed here after move
86    |
87    = note: move occurs because `x.0.0` has type `String`, which does not implement the `Copy` trait
88 help: borrow this binding in the pattern to avoid moving the value
89    |
90 LL |     let ((ref y, _) | (_, y),) = x;
91    |           +++
92
93 error[E0382]: borrow of moved value: `x.0.1`
94   --> $DIR/or-patterns.rs:40:5
95    |
96 LL |     let ((y, _) | (_, y),) = x;
97    |                       - value moved here
98 ...
99 LL |     &x.0 .1;
100    |     ^^^^^^^ value borrowed here after move
101    |
102    = note: move occurs because `x.0.1` has type `String`, which does not implement the `Copy` trait
103 help: borrow this binding in the pattern to avoid moving the value
104    |
105 LL |     let ((y, _) | (_, ref y),) = x;
106    |                       +++
107
108 error[E0502]: cannot borrow `x.0.0` as mutable because it is also borrowed as immutable
109   --> $DIR/or-patterns.rs:46:5
110    |
111 LL |     let ((ref r, _) | (_, ref r),) = x;
112    |           ----- immutable borrow occurs here
113 LL |     &mut x.0 .0;
114    |     ^^^^^^^^^^^ mutable borrow occurs here
115 ...
116 LL |     drop(r);
117    |          - immutable borrow later used here
118
119 error[E0502]: cannot borrow `x.0.1` as mutable because it is also borrowed as immutable
120   --> $DIR/or-patterns.rs:48:5
121    |
122 LL |     let ((ref r, _) | (_, ref r),) = x;
123    |                           ----- immutable borrow occurs here
124 ...
125 LL |     &mut x.0 .1;
126    |     ^^^^^^^^^^^ mutable borrow occurs here
127 LL |
128 LL |     drop(r);
129    |          - immutable borrow later used here
130
131 error[E0502]: cannot borrow `x.0.0` as immutable because it is also borrowed as mutable
132   --> $DIR/or-patterns.rs:55:5
133    |
134 LL |     let ((ref mut r, _) | (_, ref mut r),) = x;
135    |           --------- mutable borrow occurs here
136 LL |     &x.0 .0;
137    |     ^^^^^^^ immutable borrow occurs here
138 ...
139 LL |     drop(r);
140    |          - mutable borrow later used here
141
142 error[E0502]: cannot borrow `x.0.1` as immutable because it is also borrowed as mutable
143   --> $DIR/or-patterns.rs:57:5
144    |
145 LL |     let ((ref mut r, _) | (_, ref mut r),) = x;
146    |                               --------- mutable borrow occurs here
147 ...
148 LL |     &x.0 .1;
149    |     ^^^^^^^ immutable borrow occurs here
150 LL |
151 LL |     drop(r);
152    |          - mutable borrow later used here
153
154 error: aborting due to 12 previous errors
155
156 Some errors have detailed explanations: E0382, E0502.
157 For more information about an error, try `rustc --explain E0382`.