Skip to content

Commit 1dfb53b

Browse files
committed
improve wording of a suggestion
1 parent e25129b commit 1dfb53b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

compiler/rustc_typeck/src/check/pat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
697697

698698
Some((
699699
pat.span,
700-
format!("to declare a mutable {ident_kind} use `mut variable_name`"),
700+
format!("to declare a mutable {ident_kind} use"),
701701
format!("mut {binding}"),
702702
))
703703

src/test/ui/mismatched_types/ref-pat-suggestions.stderr

+7-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ LL | fn _f1(&mut _a: u32) {}
2424
|
2525
= note: expected type `u32`
2626
found mutable reference `&mut _`
27-
note: to declare a mutable parameter use `mut variable_name`: `mut _a`
27+
note: to declare a mutable parameter use: `mut _a`
2828
--> $DIR/ref-pat-suggestions.rs:4:8
2929
|
3030
LL | fn _f1(&mut _a: u32) {}
@@ -127,7 +127,7 @@ LL | let _: fn(u32) = |&mut _a| ();
127127
|
128128
= note: expected type `u32`
129129
found mutable reference `&mut _`
130-
note: to declare a mutable parameter use `mut variable_name`: `mut _a`
130+
note: to declare a mutable parameter use: `mut _a`
131131
--> $DIR/ref-pat-suggestions.rs:12:23
132132
|
133133
LL | let _: fn(u32) = |&mut _a| ();
@@ -232,7 +232,7 @@ LL | let _ = |&mut _a: u32| ();
232232
|
233233
= note: expected type `u32`
234234
found mutable reference `&mut _`
235-
note: to declare a mutable parameter use `mut variable_name`: `mut _a`
235+
note: to declare a mutable parameter use: `mut _a`
236236
--> $DIR/ref-pat-suggestions.rs:19:14
237237
|
238238
LL | let _ = |&mut _a: u32| ();
@@ -314,7 +314,7 @@ LL | let &mut _a = 0;
314314
| ^^^^^^^ - this expression has type `{integer}`
315315
| |
316316
| expected integer, found `&mut _`
317-
| help: to declare a mutable variable use `mut variable_name`: `mut _a`
317+
| help: to declare a mutable variable use: `mut _a`
318318
|
319319
= note: expected type `{integer}`
320320
found mutable reference `&mut _`
@@ -329,7 +329,7 @@ LL | let S(&mut _b) = S(0);
329329
|
330330
= note: expected type `u8`
331331
found mutable reference `&mut _`
332-
note: to declare a mutable binding use `mut variable_name`: `mut _b`
332+
note: to declare a mutable binding use: `mut _b`
333333
--> $DIR/ref-pat-suggestions.rs:30:15
334334
|
335335
LL | let S(&mut _b) = S(0);
@@ -350,7 +350,7 @@ LL | let (&mut _c,) = (0,);
350350
|
351351
= note: expected type `{integer}`
352352
found mutable reference `&mut _`
353-
note: to declare a mutable binding use `mut variable_name`: `mut _c`
353+
note: to declare a mutable binding use: `mut _c`
354354
--> $DIR/ref-pat-suggestions.rs:31:14
355355
|
356356
LL | let (&mut _c,) = (0,);
@@ -371,7 +371,7 @@ LL | &mut _d => {}
371371
|
372372
= note: expected type `{integer}`
373373
found mutable reference `&mut _`
374-
note: to declare a mutable binding use `mut variable_name`: `mut _d`
374+
note: to declare a mutable binding use: `mut _d`
375375
--> $DIR/ref-pat-suggestions.rs:34:13
376376
|
377377
LL | &mut _d => {}

src/test/ui/pattern/for-loop-bad-item.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | for ((_, _), (&mut c, _)) in &mut map {
88
|
99
= note: expected type `char`
1010
found mutable reference `&mut _`
11-
note: to declare a mutable binding use `mut variable_name`: `mut c`
11+
note: to declare a mutable binding use: `mut c`
1212
--> $DIR/for-loop-bad-item.rs:7:19
1313
|
1414
LL | for ((_, _), (&mut c, _)) in &mut map {

0 commit comments

Comments
 (0)