Skip to content

Commit 55bdf7f

Browse files
committed
Add more test case
1 parent 2d99e68 commit 55bdf7f

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

src/test/ui/anon-params/anon-params-denied-2018.rs

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ trait T {
1515
fn foo_with_qualified_path_and_ref(&<Bar as T>::Baz);
1616
//~^ ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
1717

18+
fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz);
19+
//~^ ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `,`
20+
//~| ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
21+
1822
fn bar_with_default_impl(String, String) {}
1923
//~^ ERROR expected one of `:`
2024
//~| ERROR expected one of `:`

src/test/ui/anon-params/anon-params-denied-2018.stderr

+28-4
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,32 @@ help: explicitly ignore the parameter name
6262
LL | fn foo_with_qualified_path_and_ref(_: &<Bar as T>::Baz);
6363
| ^^^^^^^^^^^^^^^^^^^
6464

65+
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `,`
66+
--> $DIR/anon-params-denied-2018.rs:18:57
67+
|
68+
LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz);
69+
| ^ expected one of 8 possible tokens
70+
|
71+
= note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
72+
help: explicitly ignore the parameter name
73+
|
74+
LL | fn foo_with_multiple_qualified_paths(_: <Bar as T>::Baz, <Bar as T>::Baz);
75+
| ^^^^^^^^^^^^^^^^^^
76+
77+
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
78+
--> $DIR/anon-params-denied-2018.rs:18:74
79+
|
80+
LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz);
81+
| ^ expected one of 8 possible tokens
82+
|
83+
= note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
84+
help: explicitly ignore the parameter name
85+
|
86+
LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, _: <Bar as T>::Baz);
87+
| ^^^^^^^^^^^^^^^^^^
88+
6589
error: expected one of `:`, `@`, or `|`, found `,`
66-
--> $DIR/anon-params-denied-2018.rs:18:36
90+
--> $DIR/anon-params-denied-2018.rs:22:36
6791
|
6892
LL | fn bar_with_default_impl(String, String) {}
6993
| ^ expected one of `:`, `@`, or `|`
@@ -83,7 +107,7 @@ LL | fn bar_with_default_impl(_: String, String) {}
83107
| ^^^^^^^^^
84108

85109
error: expected one of `:`, `@`, or `|`, found `)`
86-
--> $DIR/anon-params-denied-2018.rs:18:44
110+
--> $DIR/anon-params-denied-2018.rs:22:44
87111
|
88112
LL | fn bar_with_default_impl(String, String) {}
89113
| ^ expected one of `:`, `@`, or `|`
@@ -99,7 +123,7 @@ LL | fn bar_with_default_impl(String, _: String) {}
99123
| ^^^^^^^^^
100124

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

117-
error: aborting due to 7 previous errors
141+
error: aborting due to 9 previous errors
118142

0 commit comments

Comments
 (0)