Fix wording for anonymous parameter name help

This commit is contained in:
James Box 2020-06-27 22:55:42 -05:00
parent 9bdd2db3a6
commit 7231e57546
7 changed files with 11 additions and 11 deletions

View File

@ -1415,7 +1415,7 @@ pub(super) fn parameter_without_type(
if self.token != token::Lt {
err.span_suggestion(
pat.span,
"if this was a parameter name, give it a type",
"if this is a parameter name, give it a type",
format!("{}: TypeName", ident),
Applicability::HasPlaceholders,
);

View File

@ -9,7 +9,7 @@ help: if this is a `self` type, give it a parameter name
|
LL | fn foo(self: i32);
| ^^^^^^^^^
help: if this was a parameter name, give it a type
help: if this is a parameter name, give it a type
|
LL | fn foo(i32: TypeName);
| ^^^^^^^^^^^^^
@ -29,7 +29,7 @@ help: if this is a `self` type, give it a parameter name
|
LL | fn bar_with_default_impl(self: String, String) {}
| ^^^^^^^^^^^^
help: if this was a parameter name, give it a type
help: if this is a parameter name, give it a type
|
LL | fn bar_with_default_impl(String: TypeName, String) {}
| ^^^^^^^^^^^^^^^^
@ -45,7 +45,7 @@ LL | fn bar_with_default_impl(String, String) {}
| ^ expected one of `:`, `@`, or `|`
|
= note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
help: if this was a parameter name, give it a type
help: if this is a parameter name, give it a type
|
LL | fn bar_with_default_impl(String, String: TypeName) {}
| ^^^^^^^^^^^^^^^^
@ -61,7 +61,7 @@ LL | fn baz(a:usize, b, c: usize) -> usize {
| ^ expected one of `:`, `@`, or `|`
|
= note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
help: if this was a parameter name, give it a type
help: if this is a parameter name, give it a type
|
LL | fn baz(a:usize, b: TypeName, c: usize) -> usize {
| ^^^^^^^^^^^

View File

@ -20,7 +20,7 @@ fn pattern((i32, i32) (a, b)) {}
fn fizz(i32) {}
//~^ ERROR expected one of `:`, `@`
//~| HELP if this was a parameter name, give it a type
//~| HELP if this is a parameter name, give it a type
//~| HELP if this is a `self` type, give it a parameter name
//~| HELP if this is a type, explicitly ignore the parameter name

View File

@ -39,7 +39,7 @@ help: if this is a `self` type, give it a parameter name
|
LL | fn fizz(self: i32) {}
| ^^^^^^^^^
help: if this was a parameter name, give it a type
help: if this is a parameter name, give it a type
|
LL | fn fizz(i32: TypeName) {}
| ^^^^^^^^^^^^^

View File

@ -9,7 +9,7 @@ help: if this is a `self` type, give it a parameter name
|
LL | fn foo(self: x) {
| ^^^^^^^
help: if this was a parameter name, give it a type
help: if this is a parameter name, give it a type
|
LL | fn foo(x: TypeName) {
| ^^^^^^^^^^^

View File

@ -9,7 +9,7 @@ help: if this is a `self` type, give it a parameter name
|
LL | trait Trait2015 { fn foo(#[allow(C)] self: i32); }
| ^^^^^^^^^
help: if this was a parameter name, give it a type
help: if this is a parameter name, give it a type
|
LL | trait Trait2015 { fn foo(#[allow(C)] i32: TypeName); }
| ^^^^^^^^^^^^^

View File

@ -21,7 +21,7 @@ LL | fn foo(Option<i32>, String) {}
| ^ expected one of `:`, `@`, or `|`
|
= note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
help: if this was a parameter name, give it a type
help: if this is a parameter name, give it a type
|
LL | fn foo(Option<i32>, String: TypeName) {}
| ^^^^^^^^^^^^^^^^
@ -41,7 +41,7 @@ help: if this is a `self` type, give it a parameter name
|
LL | fn bar(self: x, y: usize) {}
| ^^^^^^^
help: if this was a parameter name, give it a type
help: if this is a parameter name, give it a type
|
LL | fn bar(x: TypeName, y: usize) {}
| ^^^^^^^^^^^