diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs index 5197b620f90ba..19c35ebd011b1 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 ad854837ae5bd..246f69558ff0d 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 6a744812e41d1..a84c048fab967 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 75e4cb3e2d819..bd7cbd444d704 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` + | help: replace with the correct type: `Option` 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 c6758c52a914e..afd6aaf4e55ab 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` + | help: replace with the correct type: `Option` 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 f868c8d483486..2b64df774b08f 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` + | help: replace with the correct type: `Option` 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