fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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