Skip to content

Commit

Permalink
Remove _ from E0121 diagnostic suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
fee1-dead committed Jun 5, 2021
1 parent 34b9932 commit d963084
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/collect/type_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ fn infer_placeholder_type(
if !ty.references_error() {
diag.span_suggestion(
span,
"replace `_` with the correct type",
"replace with the correct type",
ty.to_string(),
Applicability::MaybeIncorrect,
);
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0121.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LL | static BAR: _ = "test";
| ^
| |
| not allowed in type signatures
| help: replace `_` with the correct type: `&str`
| help: replace with the correct type: `&str`

error: aborting due to 2 previous errors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ LL | const A = "A".$fn();
| ^
| |
| not allowed in type signatures
| help: replace `_` with the correct type: `bool`
| help: replace with the correct type: `bool`
...
LL | / suite! {
LL | | len;
Expand Down
16 changes: 8 additions & 8 deletions src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ LL | static TEST3: _ = "test";
| ^
| |
| not allowed in type signatures
| help: replace `_` with the correct type: `&str`
| help: replace with the correct type: `&str`

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

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

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

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

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

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

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

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

Expand Down
16 changes: 8 additions & 8 deletions src/test/ui/typeck/typeck_type_placeholder_item.min_tait.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ LL | static TEST3: _ = "test";
| ^
| |
| not allowed in type signatures
| help: replace `_` with the correct type: `&str`
| help: replace with the correct type: `&str`

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

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

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

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

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

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

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

error: aborting due to 69 previous errors

Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/typeck/typeck_type_placeholder_item_help.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LL | const TEST2: _ = 42u32;
| ^
| |
| not allowed in type signatures
| help: replace `_` with the correct type: `u32`
| help: replace with the correct type: `u32`

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

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

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

error: aborting due to 6 previous errors

Expand Down

0 comments on commit d963084

Please sign in to comment.