Skip to content

Commit

Permalink
Add more test case
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Mar 17, 2021
1 parent 2d99e68 commit 55bdf7f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/test/ui/anon-params/anon-params-denied-2018.rs
Expand Up @@ -15,6 +15,10 @@ trait T {
fn foo_with_qualified_path_and_ref(&<Bar as T>::Baz);
//~^ ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`

fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz);
//~^ ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `,`
//~| ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`

fn bar_with_default_impl(String, String) {}
//~^ ERROR expected one of `:`
//~| ERROR expected one of `:`
Expand Down
32 changes: 28 additions & 4 deletions src/test/ui/anon-params/anon-params-denied-2018.stderr
Expand Up @@ -62,8 +62,32 @@ help: explicitly ignore the parameter name
LL | fn foo_with_qualified_path_and_ref(_: &<Bar as T>::Baz);
| ^^^^^^^^^^^^^^^^^^^

error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `,`
--> $DIR/anon-params-denied-2018.rs:18:57
|
LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz);
| ^ expected one of 8 possible tokens
|
= note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
help: explicitly ignore the parameter name
|
LL | fn foo_with_multiple_qualified_paths(_: <Bar as T>::Baz, <Bar as T>::Baz);
| ^^^^^^^^^^^^^^^^^^

error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:18:74
|
LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz);
| ^ expected one of 8 possible tokens
|
= note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
help: explicitly ignore the parameter name
|
LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, _: <Bar as T>::Baz);
| ^^^^^^^^^^^^^^^^^^

error: expected one of `:`, `@`, or `|`, found `,`
--> $DIR/anon-params-denied-2018.rs:18:36
--> $DIR/anon-params-denied-2018.rs:22:36
|
LL | fn bar_with_default_impl(String, String) {}
| ^ expected one of `:`, `@`, or `|`
Expand All @@ -83,7 +107,7 @@ LL | fn bar_with_default_impl(_: String, String) {}
| ^^^^^^^^^

error: expected one of `:`, `@`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:18:44
--> $DIR/anon-params-denied-2018.rs:22:44
|
LL | fn bar_with_default_impl(String, String) {}
| ^ expected one of `:`, `@`, or `|`
Expand All @@ -99,7 +123,7 @@ LL | fn bar_with_default_impl(String, _: String) {}
| ^^^^^^^^^

error: expected one of `:`, `@`, or `|`, found `,`
--> $DIR/anon-params-denied-2018.rs:23:22
--> $DIR/anon-params-denied-2018.rs:27:22
|
LL | fn baz(a:usize, b, c: usize) -> usize {
| ^ expected one of `:`, `@`, or `|`
Expand All @@ -114,5 +138,5 @@ help: if this is a type, explicitly ignore the parameter name
LL | fn baz(a:usize, _: b, c: usize) -> usize {
| ^^^^

error: aborting due to 7 previous errors
error: aborting due to 9 previous errors

0 comments on commit 55bdf7f

Please sign in to comment.