Skip to content

Commit d7d2548

Browse files
Rollup merge of #86058 - fee1-dead:E0121-improvements, r=jackh726
Remove `_` from E0121 diagnostic suggestions Fixes #86021.
2 parents 00a704f + d963084 commit d7d2548

6 files changed

+23
-23
lines changed

compiler/rustc_typeck/src/collect/type_of.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ fn infer_placeholder_type(
766766
if !ty.references_error() {
767767
diag.span_suggestion(
768768
span,
769-
"replace `_` with the correct type",
769+
"replace with the correct type",
770770
ty.to_string(),
771771
Applicability::MaybeIncorrect,
772772
);

src/test/ui/error-codes/E0121.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | static BAR: _ = "test";
1414
| ^
1515
| |
1616
| not allowed in type signatures
17-
| help: replace `_` with the correct type: `&str`
17+
| help: replace with the correct type: `&str`
1818

1919
error: aborting due to 2 previous errors
2020

src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ LL | const A = "A".$fn();
3737
| ^
3838
| |
3939
| not allowed in type signatures
40-
| help: replace `_` with the correct type: `bool`
40+
| help: replace with the correct type: `bool`
4141
...
4242
LL | / suite! {
4343
LL | | len;

src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ LL | static TEST3: _ = "test";
7979
| ^
8080
| |
8181
| not allowed in type signatures
82-
| help: replace `_` with the correct type: `&str`
82+
| help: replace with the correct type: `&str`
8383

8484
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
8585
--> $DIR/typeck_type_placeholder_item.rs:19:15
@@ -88,7 +88,7 @@ LL | static TEST4: _ = 145;
8888
| ^
8989
| |
9090
| not allowed in type signatures
91-
| help: replace `_` with the correct type: `i32`
91+
| help: replace with the correct type: `i32`
9292

9393
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
9494
--> $DIR/typeck_type_placeholder_item.rs:22:15
@@ -210,7 +210,7 @@ LL | static B: _ = 42;
210210
| ^
211211
| |
212212
| not allowed in type signatures
213-
| help: replace `_` with the correct type: `i32`
213+
| help: replace with the correct type: `i32`
214214

215215
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
216216
--> $DIR/typeck_type_placeholder_item.rs:80:15
@@ -244,7 +244,7 @@ LL | static FN_TEST3: _ = "test";
244244
| ^
245245
| |
246246
| not allowed in type signatures
247-
| help: replace `_` with the correct type: `&str`
247+
| help: replace with the correct type: `&str`
248248

249249
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
250250
--> $DIR/typeck_type_placeholder_item.rs:92:22
@@ -253,7 +253,7 @@ LL | static FN_TEST4: _ = 145;
253253
| ^
254254
| |
255255
| not allowed in type signatures
256-
| help: replace `_` with the correct type: `i32`
256+
| help: replace with the correct type: `i32`
257257

258258
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
259259
--> $DIR/typeck_type_placeholder_item.rs:95:22
@@ -435,7 +435,7 @@ LL | const _: Option<_> = map(value);
435435
| ^^^^^^^^^
436436
| |
437437
| not allowed in type signatures
438-
| help: replace `_` with the correct type: `Option<u8>`
438+
| help: replace with the correct type: `Option<u8>`
439439

440440
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
441441
--> $DIR/typeck_type_placeholder_item.rs:144:31
@@ -526,7 +526,7 @@ LL | const D: _ = 42;
526526
| ^
527527
| |
528528
| not allowed in type signatures
529-
| help: replace `_` with the correct type: `i32`
529+
| help: replace with the correct type: `i32`
530530

531531
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
532532
--> $DIR/typeck_type_placeholder_item.rs:201:26
@@ -639,7 +639,7 @@ LL | const D: _ = 42;
639639
| ^
640640
| |
641641
| not allowed in type signatures
642-
| help: replace `_` with the correct type: `i32`
642+
| help: replace with the correct type: `i32`
643643

644644
error: aborting due to 69 previous errors; 1 warning emitted
645645

src/test/ui/typeck/typeck_type_placeholder_item.min_tait.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ LL | static TEST3: _ = "test";
7070
| ^
7171
| |
7272
| not allowed in type signatures
73-
| help: replace `_` with the correct type: `&str`
73+
| help: replace with the correct type: `&str`
7474

7575
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
7676
--> $DIR/typeck_type_placeholder_item.rs:19:15
@@ -79,7 +79,7 @@ LL | static TEST4: _ = 145;
7979
| ^
8080
| |
8181
| not allowed in type signatures
82-
| help: replace `_` with the correct type: `i32`
82+
| help: replace with the correct type: `i32`
8383

8484
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
8585
--> $DIR/typeck_type_placeholder_item.rs:22:15
@@ -201,7 +201,7 @@ LL | static B: _ = 42;
201201
| ^
202202
| |
203203
| not allowed in type signatures
204-
| help: replace `_` with the correct type: `i32`
204+
| help: replace with the correct type: `i32`
205205

206206
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
207207
--> $DIR/typeck_type_placeholder_item.rs:80:15
@@ -235,7 +235,7 @@ LL | static FN_TEST3: _ = "test";
235235
| ^
236236
| |
237237
| not allowed in type signatures
238-
| help: replace `_` with the correct type: `&str`
238+
| help: replace with the correct type: `&str`
239239

240240
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
241241
--> $DIR/typeck_type_placeholder_item.rs:92:22
@@ -244,7 +244,7 @@ LL | static FN_TEST4: _ = 145;
244244
| ^
245245
| |
246246
| not allowed in type signatures
247-
| help: replace `_` with the correct type: `i32`
247+
| help: replace with the correct type: `i32`
248248

249249
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
250250
--> $DIR/typeck_type_placeholder_item.rs:95:22
@@ -426,7 +426,7 @@ LL | const _: Option<_> = map(value);
426426
| ^^^^^^^^^
427427
| |
428428
| not allowed in type signatures
429-
| help: replace `_` with the correct type: `Option<u8>`
429+
| help: replace with the correct type: `Option<u8>`
430430

431431
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
432432
--> $DIR/typeck_type_placeholder_item.rs:144:31
@@ -517,7 +517,7 @@ LL | const D: _ = 42;
517517
| ^
518518
| |
519519
| not allowed in type signatures
520-
| help: replace `_` with the correct type: `i32`
520+
| help: replace with the correct type: `i32`
521521

522522
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
523523
--> $DIR/typeck_type_placeholder_item.rs:201:26
@@ -630,7 +630,7 @@ LL | const D: _ = 42;
630630
| ^
631631
| |
632632
| not allowed in type signatures
633-
| help: replace `_` with the correct type: `i32`
633+
| help: replace with the correct type: `i32`
634634

635635
error: aborting due to 69 previous errors
636636

src/test/ui/typeck/typeck_type_placeholder_item_help.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | const TEST2: _ = 42u32;
1414
| ^
1515
| |
1616
| not allowed in type signatures
17-
| help: replace `_` with the correct type: `u32`
17+
| help: replace with the correct type: `u32`
1818

1919
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
2020
--> $DIR/typeck_type_placeholder_item_help.rs:10:14
@@ -23,7 +23,7 @@ LL | const TEST3: _ = Some(42);
2323
| ^
2424
| |
2525
| not allowed in type signatures
26-
| help: replace `_` with the correct type: `Option<i32>`
26+
| help: replace with the correct type: `Option<i32>`
2727

2828
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
2929
--> $DIR/typeck_type_placeholder_item_help.rs:13:22
@@ -38,7 +38,7 @@ LL | const TEST5: _ = 42;
3838
| ^
3939
| |
4040
| not allowed in type signatures
41-
| help: replace `_` with the correct type: `i32`
41+
| help: replace with the correct type: `i32`
4242

4343
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
4444
--> $DIR/typeck_type_placeholder_item_help.rs:24:18
@@ -47,7 +47,7 @@ LL | const TEST6: _ = 13;
4747
| ^
4848
| |
4949
| not allowed in type signatures
50-
| help: replace `_` with the correct type: `i32`
50+
| help: replace with the correct type: `i32`
5151

5252
error: aborting due to 6 previous errors
5353

0 commit comments

Comments
 (0)