Skip to content

Commit b367c25

Browse files
committed
Tweak wording
1 parent 2d3435b commit b367c25

7 files changed

+36
-36
lines changed

compiler/rustc_mir_build/messages.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mir_build_borrow_of_layout_constrained_field_requires_unsafe_unsafe_op_in_unsafe
2424
2525
mir_build_borrow_of_moved_value = borrow of moved value
2626
.label = value moved into `{$name}` here
27-
.occurs_because_label = move occurs because `{$name}` has type `{$ty}` which does not implement the `Copy` trait
27+
.occurs_because_label = move occurs because `{$name}` has type `{$ty}`, which does not implement the `Copy` trait
2828
.value_borrowed_label = value borrowed here after move
2929
.suggestion = borrow this binding in the pattern to avoid moving the value
3030

tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LL | Some(_z @ ref _y) => {}
1313
| ^^ ------ value borrowed here after move
1414
| |
1515
| value moved into `_z` here
16-
| move occurs because `_z` has type `X` which does not implement the `Copy` trait
16+
| move occurs because `_z` has type `X`, which does not implement the `Copy` trait
1717
|
1818
help: borrow this binding in the pattern to avoid moving the value
1919
|
@@ -35,7 +35,7 @@ LL | Some(_z @ ref mut _y) => {}
3535
| ^^ ---------- value borrowed here after move
3636
| |
3737
| value moved into `_z` here
38-
| move occurs because `_z` has type `X` which does not implement the `Copy` trait
38+
| move occurs because `_z` has type `X`, which does not implement the `Copy` trait
3939
|
4040
help: borrow this binding in the pattern to avoid moving the value
4141
|

tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let a @ ref b = U;
55
| ^ ----- value borrowed here after move
66
| |
77
| value moved into `a` here
8-
| move occurs because `a` has type `U` which does not implement the `Copy` trait
8+
| move occurs because `a` has type `U`, which does not implement the `Copy` trait
99
|
1010
help: borrow this binding in the pattern to avoid moving the value
1111
|

tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr

+25-25
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let a @ ref b = U;
55
| ^ ----- value borrowed here after move
66
| |
77
| value moved into `a` here
8-
| move occurs because `a` has type `U` which does not implement the `Copy` trait
8+
| move occurs because `a` has type `U`, which does not implement the `Copy` trait
99
|
1010
help: borrow this binding in the pattern to avoid moving the value
1111
|
@@ -20,7 +20,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
2020
| | |
2121
| | value borrowed here after move
2222
| value moved into `a` here
23-
| move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
23+
| move occurs because `a` has type `(U, U)`, which does not implement the `Copy` trait
2424
|
2525
help: borrow this binding in the pattern to avoid moving the value
2626
|
@@ -34,7 +34,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
3434
| ^^^^^ --------- value borrowed here after move
3535
| |
3636
| value moved into `b` here
37-
| move occurs because `b` has type `U` which does not implement the `Copy` trait
37+
| move occurs because `b` has type `U`, which does not implement the `Copy` trait
3838
|
3939
help: borrow this binding in the pattern to avoid moving the value
4040
|
@@ -48,7 +48,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
4848
| ^ ----- value borrowed here after move
4949
| |
5050
| value moved into `d` here
51-
| move occurs because `d` has type `U` which does not implement the `Copy` trait
51+
| move occurs because `d` has type `U`, which does not implement the `Copy` trait
5252
|
5353
help: borrow this binding in the pattern to avoid moving the value
5454
|
@@ -63,7 +63,7 @@ LL | let a @ [ref mut b, ref c] = [U, U];
6363
| | |
6464
| | value borrowed here after move
6565
| value moved into `a` here
66-
| move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait
66+
| move occurs because `a` has type `[U; 2]`, which does not implement the `Copy` trait
6767
|
6868
help: borrow this binding in the pattern to avoid moving the value
6969
|
@@ -77,7 +77,7 @@ LL | let a @ ref b = u();
7777
| ^ ----- value borrowed here after move
7878
| |
7979
| value moved into `a` here
80-
| move occurs because `a` has type `U` which does not implement the `Copy` trait
80+
| move occurs because `a` has type `U`, which does not implement the `Copy` trait
8181
|
8282
help: borrow this binding in the pattern to avoid moving the value
8383
|
@@ -92,7 +92,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
9292
| | |
9393
| | value borrowed here after move
9494
| value moved into `a` here
95-
| move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
95+
| move occurs because `a` has type `(U, U)`, which does not implement the `Copy` trait
9696
|
9797
help: borrow this binding in the pattern to avoid moving the value
9898
|
@@ -106,7 +106,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
106106
| ^^^^^ --------- value borrowed here after move
107107
| |
108108
| value moved into `b` here
109-
| move occurs because `b` has type `U` which does not implement the `Copy` trait
109+
| move occurs because `b` has type `U`, which does not implement the `Copy` trait
110110
|
111111
help: borrow this binding in the pattern to avoid moving the value
112112
|
@@ -120,7 +120,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
120120
| ^ ----- value borrowed here after move
121121
| |
122122
| value moved into `d` here
123-
| move occurs because `d` has type `U` which does not implement the `Copy` trait
123+
| move occurs because `d` has type `U`, which does not implement the `Copy` trait
124124
|
125125
help: borrow this binding in the pattern to avoid moving the value
126126
|
@@ -135,7 +135,7 @@ LL | let a @ [ref mut b, ref c] = [u(), u()];
135135
| | |
136136
| | value borrowed here after move
137137
| value moved into `a` here
138-
| move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait
138+
| move occurs because `a` has type `[U; 2]`, which does not implement the `Copy` trait
139139
|
140140
help: borrow this binding in the pattern to avoid moving the value
141141
|
@@ -149,7 +149,7 @@ LL | a @ Some(ref b) => {}
149149
| ^ ----- value borrowed here after move
150150
| |
151151
| value moved into `a` here
152-
| move occurs because `a` has type `Option<U>` which does not implement the `Copy` trait
152+
| move occurs because `a` has type `Option<U>`, which does not implement the `Copy` trait
153153
|
154154
help: borrow this binding in the pattern to avoid moving the value
155155
|
@@ -164,7 +164,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
164164
| | |
165165
| | value borrowed here after move
166166
| value moved into `a` here
167-
| move occurs because `a` has type `Option<(U, U)>` which does not implement the `Copy` trait
167+
| move occurs because `a` has type `Option<(U, U)>`, which does not implement the `Copy` trait
168168
|
169169
help: borrow this binding in the pattern to avoid moving the value
170170
|
@@ -178,7 +178,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
178178
| ^^^^^ --------- value borrowed here after move
179179
| |
180180
| value moved into `b` here
181-
| move occurs because `b` has type `U` which does not implement the `Copy` trait
181+
| move occurs because `b` has type `U`, which does not implement the `Copy` trait
182182
|
183183
help: borrow this binding in the pattern to avoid moving the value
184184
|
@@ -192,7 +192,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
192192
| ^ ----- value borrowed here after move
193193
| |
194194
| value moved into `d` here
195-
| move occurs because `d` has type `U` which does not implement the `Copy` trait
195+
| move occurs because `d` has type `U`, which does not implement the `Copy` trait
196196
|
197197
help: borrow this binding in the pattern to avoid moving the value
198198
|
@@ -207,7 +207,7 @@ LL | mut a @ Some([ref b, ref mut c]) => {}
207207
| | |
208208
| | value borrowed here after move
209209
| value moved into `a` here
210-
| move occurs because `a` has type `Option<[U; 2]>` which does not implement the `Copy` trait
210+
| move occurs because `a` has type `Option<[U; 2]>`, which does not implement the `Copy` trait
211211
|
212212
help: borrow this binding in the pattern to avoid moving the value
213213
|
@@ -221,7 +221,7 @@ LL | a @ Some(ref b) => {}
221221
| ^ ----- value borrowed here after move
222222
| |
223223
| value moved into `a` here
224-
| move occurs because `a` has type `Option<U>` which does not implement the `Copy` trait
224+
| move occurs because `a` has type `Option<U>`, which does not implement the `Copy` trait
225225
|
226226
help: borrow this binding in the pattern to avoid moving the value
227227
|
@@ -236,7 +236,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
236236
| | |
237237
| | value borrowed here after move
238238
| value moved into `a` here
239-
| move occurs because `a` has type `Option<(U, U)>` which does not implement the `Copy` trait
239+
| move occurs because `a` has type `Option<(U, U)>`, which does not implement the `Copy` trait
240240
|
241241
help: borrow this binding in the pattern to avoid moving the value
242242
|
@@ -250,7 +250,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
250250
| ^^^^^ --------- value borrowed here after move
251251
| |
252252
| value moved into `b` here
253-
| move occurs because `b` has type `U` which does not implement the `Copy` trait
253+
| move occurs because `b` has type `U`, which does not implement the `Copy` trait
254254
|
255255
help: borrow this binding in the pattern to avoid moving the value
256256
|
@@ -264,7 +264,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
264264
| ^ ----- value borrowed here after move
265265
| |
266266
| value moved into `d` here
267-
| move occurs because `d` has type `U` which does not implement the `Copy` trait
267+
| move occurs because `d` has type `U`, which does not implement the `Copy` trait
268268
|
269269
help: borrow this binding in the pattern to avoid moving the value
270270
|
@@ -279,7 +279,7 @@ LL | mut a @ Some([ref b, ref mut c]) => {}
279279
| | |
280280
| | value borrowed here after move
281281
| value moved into `a` here
282-
| move occurs because `a` has type `Option<[U; 2]>` which does not implement the `Copy` trait
282+
| move occurs because `a` has type `Option<[U; 2]>`, which does not implement the `Copy` trait
283283
|
284284
help: borrow this binding in the pattern to avoid moving the value
285285
|
@@ -349,7 +349,7 @@ LL | fn f1(a @ ref b: U) {}
349349
| ^ ----- value borrowed here after move
350350
| |
351351
| value moved into `a` here
352-
| move occurs because `a` has type `U` which does not implement the `Copy` trait
352+
| move occurs because `a` has type `U`, which does not implement the `Copy` trait
353353
|
354354
help: borrow this binding in the pattern to avoid moving the value
355355
|
@@ -364,7 +364,7 @@ LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
364364
| | |
365365
| | value borrowed here after move
366366
| value moved into `a` here
367-
| move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
367+
| move occurs because `a` has type `(U, U)`, which does not implement the `Copy` trait
368368
|
369369
help: borrow this binding in the pattern to avoid moving the value
370370
|
@@ -378,7 +378,7 @@ LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
378378
| ^ ----- value borrowed here after move
379379
| |
380380
| value moved into `b` here
381-
| move occurs because `b` has type `U` which does not implement the `Copy` trait
381+
| move occurs because `b` has type `U`, which does not implement the `Copy` trait
382382
|
383383
help: borrow this binding in the pattern to avoid moving the value
384384
|
@@ -392,7 +392,7 @@ LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
392392
| ^^^^^ ----- value borrowed here after move
393393
| |
394394
| value moved into `d` here
395-
| move occurs because `d` has type `U` which does not implement the `Copy` trait
395+
| move occurs because `d` has type `U`, which does not implement the `Copy` trait
396396
|
397397
help: borrow this binding in the pattern to avoid moving the value
398398
|
@@ -417,7 +417,7 @@ LL | fn f3(a @ [ref mut b, ref c]: [U; 2]) {}
417417
| | |
418418
| | value borrowed here after move
419419
| value moved into `a` here
420-
| move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait
420+
| move occurs because `a` has type `[U; 2]`, which does not implement the `Copy` trait
421421
|
422422
help: borrow this binding in the pattern to avoid moving the value
423423
|

tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ LL | let a @ (ref mut b, ref mut c) = (U, U);
7878
| | |
7979
| | value borrowed here after move
8080
| value moved into `a` here
81-
| move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
81+
| move occurs because `a` has type `(U, U)`, which does not implement the `Copy` trait
8282
|
8383
help: borrow this binding in the pattern to avoid moving the value
8484
|
@@ -94,7 +94,7 @@ LL | let a @ (b, [c, d]) = &mut val; // Same as ^--
9494
| | | value borrowed here after move
9595
| | value borrowed here after move
9696
| value moved into `a` here
97-
| move occurs because `a` has type `&mut (U, [U; 2])` which does not implement the `Copy` trait
97+
| move occurs because `a` has type `&mut (U, [U; 2])`, which does not implement the `Copy` trait
9898
|
9999
help: borrow this binding in the pattern to avoid moving the value
100100
|
@@ -108,7 +108,7 @@ LL | let a @ &mut ref mut b = &mut U;
108108
| ^ --------- value borrowed here after move
109109
| |
110110
| value moved into `a` here
111-
| move occurs because `a` has type `&mut U` which does not implement the `Copy` trait
111+
| move occurs because `a` has type `&mut U`, which does not implement the `Copy` trait
112112
|
113113
help: borrow this binding in the pattern to avoid moving the value
114114
|
@@ -123,7 +123,7 @@ LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
123123
| | |
124124
| | value borrowed here after move
125125
| value moved into `a` here
126-
| move occurs because `a` has type `&mut (U, U)` which does not implement the `Copy` trait
126+
| move occurs because `a` has type `&mut (U, U)`, which does not implement the `Copy` trait
127127
|
128128
help: borrow this binding in the pattern to avoid moving the value
129129
|

tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ LL | Ok(ref a @ b) | Err(b @ ref a) => {
2929
| ^ ----- value borrowed here after move
3030
| |
3131
| value moved into `b` here
32-
| move occurs because `b` has type `NotCopy` which does not implement the `Copy` trait
32+
| move occurs because `b` has type `NotCopy`, which does not implement the `Copy` trait
3333
|
3434
help: borrow this binding in the pattern to avoid moving the value
3535
|

tests/ui/suggestions/ref-pattern-binding.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let _moved @ ref _from = String::from("foo");
55
| ^^^^^^ --------- value borrowed here after move
66
| |
77
| value moved into `_moved` here
8-
| move occurs because `_moved` has type `String` which does not implement the `Copy` trait
8+
| move occurs because `_moved` has type `String`, which does not implement the `Copy` trait
99
|
1010
help: borrow this binding in the pattern to avoid moving the value
1111
|
@@ -35,7 +35,7 @@ LL | let _moved @ S { ref f } = S { f: String::from("foo") };
3535
| ^^^^^^ ----- value borrowed here after move
3636
| |
3737
| value moved into `_moved` here
38-
| move occurs because `_moved` has type `S` which does not implement the `Copy` trait
38+
| move occurs because `_moved` has type `S`, which does not implement the `Copy` trait
3939
|
4040
help: borrow this binding in the pattern to avoid moving the value
4141
|

0 commit comments

Comments
 (0)