about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-06-07 01:06:54 +0200
committerGitHub <noreply@github.com>2021-06-07 01:06:54 +0200
commitd7d2548eb0b9e97976510410bf3d667dca44abc1 (patch)
treec0d0f76959bda58b9fed2a297b169b0456c70372
parent00a704f1824d798bb2b0bd8592de79b59f2b64d5 (diff)
parentd9630848d7a4a6478108f79ae0ce6028570dc732 (diff)
downloadrust-d7d2548eb0b9e97976510410bf3d667dca44abc1.tar.gz
rust-d7d2548eb0b9e97976510410bf3d667dca44abc1.zip
Rollup merge of #86058 - fee1-dead:E0121-improvements, r=jackh726
Remove `_`  from E0121 diagnostic suggestions

Fixes #86021.
-rw-r--r--compiler/rustc_typeck/src/collect/type_of.rs2
-rw-r--r--src/test/ui/error-codes/E0121.stderr2
-rw-r--r--src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr2
-rw-r--r--src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr16
-rw-r--r--src/test/ui/typeck/typeck_type_placeholder_item.min_tait.stderr16
-rw-r--r--src/test/ui/typeck/typeck_type_placeholder_item_help.stderr8
6 files changed, 23 insertions, 23 deletions
diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs
index 5197b620f90..19c35ebd011 100644
--- a/compiler/rustc_typeck/src/collect/type_of.rs
+++ b/compiler/rustc_typeck/src/collect/type_of.rs
@@ -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,
                 );
diff --git a/src/test/ui/error-codes/E0121.stderr b/src/test/ui/error-codes/E0121.stderr
index ad854837ae5..246f69558ff 100644
--- a/src/test/ui/error-codes/E0121.stderr
+++ b/src/test/ui/error-codes/E0121.stderr
@@ -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
 
diff --git a/src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr b/src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr
index 6a744812e41..a84c048fab9 100644
--- a/src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr
+++ b/src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr
@@ -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;
diff --git a/src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr b/src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr
index 75e4cb3e2d8..bd7cbd444d7 100644
--- a/src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr
+++ b/src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
 
diff --git a/src/test/ui/typeck/typeck_type_placeholder_item.min_tait.stderr b/src/test/ui/typeck/typeck_type_placeholder_item.min_tait.stderr
index c6758c52a91..afd6aaf4e55 100644
--- a/src/test/ui/typeck/typeck_type_placeholder_item.min_tait.stderr
+++ b/src/test/ui/typeck/typeck_type_placeholder_item.min_tait.stderr
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
 
diff --git a/src/test/ui/typeck/typeck_type_placeholder_item_help.stderr b/src/test/ui/typeck/typeck_type_placeholder_item_help.stderr
index f868c8d4834..2b64df774b0 100644
--- a/src/test/ui/typeck/typeck_type_placeholder_item_help.stderr
+++ b/src/test/ui/typeck/typeck_type_placeholder_item_help.stderr
@@ -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
@@ -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
@@ -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
@@ -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