Skip to content

Commit 8a981b6

Browse files
Use /* value */ as a placeholder
1 parent ccfcd95 commit 8a981b6

11 files changed

+31
-31
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4592,7 +4592,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
45924592
.join(", "),
45934593
if tys.len() == 1 { "," } else { "" }
45944594
),
4595-
_ => "value".to_string(),
4595+
_ => "/* value */".to_string(),
45964596
})
45974597
}
45984598
}

tests/ui/borrowck/borrowck-init-in-fru.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ LL | origin = Point { x: 10, ..origin };
88
|
99
help: consider assigning a value
1010
|
11-
LL | let mut origin: Point = value;
12-
| +++++++
11+
LL | let mut origin: Point = /* value */;
12+
| +++++++++++++
1313

1414
error: aborting due to 1 previous error
1515

tests/ui/borrowck/borrowck-uninit-ref-chain.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ LL | let _y = &**x;
2121
|
2222
help: consider assigning a value
2323
|
24-
LL | let x: &&S<i32, i32> = &&value;
25-
| +++++++++
24+
LL | let x: &&S<i32, i32> = &&/* value */;
25+
| +++++++++++++++
2626

2727
error[E0381]: used binding `x` isn't initialized
2828
--> $DIR/borrowck-uninit-ref-chain.rs:14:14

tests/ui/borrowck/issue-103250.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ LL | Err(last_error)
99
|
1010
help: consider assigning a value
1111
|
12-
LL | let mut last_error: Box<dyn std::error::Error> = Box::new(value);
13-
| +++++++++++++++++
12+
LL | let mut last_error: Box<dyn std::error::Error> = Box::new(/* value */);
13+
| +++++++++++++++++++++++
1414

1515
error: aborting due to 1 previous error
1616

tests/ui/borrowck/suggest-assign-rvalue.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ LL | println!("demo_no: {:?}", demo_no);
5050
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
5151
help: consider assigning a value
5252
|
53-
LL | let demo_no: DemoNoDef = value;
54-
| +++++++
53+
LL | let demo_no: DemoNoDef = /* value */;
54+
| +++++++++++++
5555

5656
error[E0381]: used binding `arr` isn't initialized
5757
--> $DIR/suggest-assign-rvalue.rs:34:27

tests/ui/consts/value-suggestion-ice-123906.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ LL | break;
1010
|
1111
help: give the `break` a value of the expected type
1212
|
13-
LL | break value;
14-
| +++++
13+
LL | break /* value */;
14+
| +++++++++++
1515

1616
error: aborting due to 1 previous error
1717

tests/ui/loops/loop-break-value.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ LL | break;
246246
|
247247
help: give the `break` a value of the expected type
248248
|
249-
LL | break value;
250-
| +++++
249+
LL | break /* value */;
250+
| +++++++++++
251251

252252
error[E0308]: mismatched types
253253
--> $DIR/loop-break-value.rs:112:9
@@ -260,8 +260,8 @@ LL | break;
260260
|
261261
help: give the `break` a value of the expected type
262262
|
263-
LL | break value;
264-
| +++++
263+
LL | break /* value */;
264+
| +++++++++++
265265

266266
error[E0308]: mismatched types
267267
--> $DIR/loop-break-value.rs:124:9
@@ -274,8 +274,8 @@ LL | break 'a;
274274
|
275275
help: give the `break` a value of the expected type
276276
|
277-
LL | break 'a value;
278-
| +++++
277+
LL | break 'a /* value */;
278+
| +++++++++++
279279

280280
error[E0308]: mismatched types
281281
--> $DIR/loop-break-value.rs:135:15
@@ -297,8 +297,8 @@ LL | break 'a;
297297
|
298298
help: give the `break` a value of the expected type
299299
|
300-
LL | break 'a value;
301-
| +++++
300+
LL | break 'a /* value */;
301+
| +++++++++++
302302

303303
error[E0308]: mismatched types
304304
--> $DIR/loop-break-value.rs:147:15
@@ -320,8 +320,8 @@ LL | break 'a;
320320
|
321321
help: give the `break` a value of the expected type
322322
|
323-
LL | break 'a value;
324-
| +++++
323+
LL | break 'a /* value */;
324+
| +++++++++++
325325

326326
error[E0308]: mismatched types
327327
--> $DIR/loop-break-value.rs:159:15

tests/ui/moves/issue-72649-uninit-in-loop.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ LL | let _used = value;
8080
|
8181
help: consider assigning a value
8282
|
83-
LL | let value: NonCopy = value;
84-
| +++++++
83+
LL | let value: NonCopy = /* value */;
84+
| +++++++++++++
8585

8686
error[E0381]: used binding `value` isn't initialized
8787
--> $DIR/issue-72649-uninit-in-loop.rs:73:21
@@ -94,8 +94,8 @@ LL | let _used = value;
9494
|
9595
help: consider assigning a value
9696
|
97-
LL | let mut value: NonCopy = value;
98-
| +++++++
97+
LL | let mut value: NonCopy = /* value */;
98+
| +++++++++++++
9999

100100
error: aborting due to 6 previous errors
101101

tests/ui/moves/move-into-dead-array-1.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ LL | a[i] = d();
88
|
99
help: consider assigning a value
1010
|
11-
LL | let mut a: [D; 4] = [value; 4];
12-
| ++++++++++++
11+
LL | let mut a: [D; 4] = [/* value */; 4];
12+
| ++++++++++++++++++
1313

1414
error: aborting due to 1 previous error
1515

tests/ui/moves/move-of-addr-of-mut.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ LL | std::ptr::addr_of_mut!(x);
99
= note: this error originates in the macro `std::ptr::addr_of_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
1010
help: consider assigning a value
1111
|
12-
LL | let mut x: S = value;
13-
| +++++++
12+
LL | let mut x: S = /* value */;
13+
| +++++++++++++
1414

1515
error: aborting due to 1 previous error
1616

tests/ui/nll/match-on-borrowed.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ LL | match n {}
4343
|
4444
help: consider assigning a value
4545
|
46-
LL | let n: Never = value;
47-
| +++++++
46+
LL | let n: Never = /* value */;
47+
| +++++++++++++
4848

4949
error: aborting due to 4 previous errors
5050

0 commit comments

Comments
 (0)