Skip to content

Commit 4d2e272

Browse files
committed
add error message for c# style named arguments
2 parents 899859f + a78747c commit 4d2e272

File tree

6 files changed

+172
-1
lines changed

6 files changed

+172
-1
lines changed

tests/ui/parser/issues/issue-111416.stderr

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,29 @@ LL - let my = monad_bind(mx, T: Try);
1010
LL + let my = monad_bind(mx, Try);
1111
|
1212

13+
<<<<<<< HEAD
1314
error[E0425]: cannot find value `mx` in this scope
1415
--> $DIR/issue-111416.rs:2:25
1516
|
1617
LL | let my = monad_bind(mx, T: Try);
1718
| ^^ not found in this scope
1819

20+
=======
21+
error: expected one of `)` or `,`, found `Try`
22+
--> $DIR/issue-111416.rs:2:32
23+
|
24+
LL | let my = monad_bind(mx, T: Try);
25+
| -^^^ expected one of `)` or `,`
26+
| |
27+
| help: missing `,`
28+
29+
error[E0425]: cannot find value `mx` in this scope
30+
--> $DIR/issue-111416.rs:2:25
31+
|
32+
LL | let my = monad_bind(mx, T: Try);
33+
| ^^ not found in this scope
34+
35+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
1936
error[E0425]: cannot find value `Try` in this scope
2037
--> $DIR/issue-111416.rs:2:32
2138
|
@@ -28,6 +45,10 @@ error[E0425]: cannot find function `monad_bind` in this scope
2845
LL | let my = monad_bind(mx, T: Try);
2946
| ^^^^^^^^^^ not found in this scope
3047

48+
<<<<<<< HEAD
3149
error: aborting due to 4 previous errors
50+
=======
51+
error: aborting due to 5 previous errors
52+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
3253

3354
For more information about this error, try `rustc --explain E0425`.

tests/ui/parser/issues/issue-34255-1.stderr

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ LL | Test::Drill(field: 42);
1919
| expected one of 8 possible tokens
2020
| help: missing `,`
2121

22+
<<<<<<< HEAD
23+
=======
24+
error: expected one of `)` or `,`, found `42`
25+
--> $DIR/issue-34255-1.rs:8:24
26+
|
27+
LL | Test::Drill(field: 42);
28+
| -^^ expected one of `)` or `,`
29+
| |
30+
| help: missing `,`
31+
32+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
2233
error[E0425]: cannot find value `field` in this scope
2334
--> $DIR/issue-34255-1.rs:8:17
2435
|
@@ -31,7 +42,11 @@ error[E0533]: expected value, found struct variant `Test::Drill`
3142
LL | Test::Drill(field: 42);
3243
| ^^^^^^^^^^^ not a value
3344

45+
<<<<<<< HEAD
3446
error: aborting due to 4 previous errors
47+
=======
48+
error: aborting due to 5 previous errors
49+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
3550

3651
Some errors have detailed explanations: E0425, E0533.
3752
For more information about an error, try `rustc --explain E0425`.

tests/ui/parser/issues/issue-44406.stderr

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ LL | foo!(true);
2828
|
2929
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
3030

31+
<<<<<<< HEAD
32+
=======
33+
error: expected one of `)` or `,`, found keyword `true`
34+
--> $DIR/issue-44406.rs:8:10
35+
|
36+
LL | bar(baz: $rest)
37+
| - help: missing `,`
38+
...
39+
LL | foo!(true);
40+
| ^^^^ expected one of `)` or `,`
41+
42+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
3143
error[E0425]: cannot find value `baz` in this scope
3244
--> $DIR/issue-44406.rs:3:13
3345
|
@@ -50,6 +62,10 @@ LL | foo!(true);
5062
|
5163
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
5264

65+
<<<<<<< HEAD
5366
error: aborting due to 4 previous errors
67+
=======
68+
error: aborting due to 5 previous errors
69+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
5470

5571
For more information about this error, try `rustc --explain E0425`.

tests/ui/parser/issues/issue-91461.stderr

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
error: expected expression, found `:`
22
--> $DIR/issue-91461.rs:2:8
3+
<<<<<<< HEAD
34
|
45
LL | a(_:b:,)
56
| ^ expected expression
@@ -21,15 +22,81 @@ LL | a(_:b:,)
2122

2223
error: expected identifier, found reserved identifier `_`
2324
--> $DIR/issue-91461.rs:2:7
25+
=======
26+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
2427
|
2528
LL | a(_:b:,)
26-
| ^ expected identifier, found reserved identifier
29+
| ^ expected expression
30+
|
31+
help: if this is a parameter, remove the name for the parameter
32+
|
33+
LL - a(_:b:,)
34+
LL + a(b:,)
35+
|
2736

2837
error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
2938
--> $DIR/issue-91461.rs:2:10
3039
|
3140
LL | a(_:b:,)
41+
<<<<<<< HEAD
3242
| ^ expected one of 8 possible tokens
3343

3444
error: aborting due to 4 previous errors
45+
=======
46+
| ^
47+
| |
48+
| expected one of `)`, `,`, `.`, `?`, or an operator
49+
| help: missing `,`
50+
51+
error: expected one of `)` or `,`, found `b`
52+
--> $DIR/issue-91461.rs:2:9
53+
|
54+
LL | a(_:b:,)
55+
| ^
56+
| |
57+
| expected one of `)` or `,`
58+
| help: missing `,`
59+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
60+
61+
error: expected expression, found `:`
62+
--> $DIR/issue-91461.rs:2:10
63+
|
64+
LL | a(_:b:,)
65+
| ^ expected expression
66+
|
67+
help: if this is a parameter, remove the name for the parameter
68+
|
69+
LL - a(_:b:,)
70+
LL + a(_:,)
71+
|
72+
73+
error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
74+
--> $DIR/issue-91461.rs:2:10
75+
|
76+
LL | a(_:b:,)
77+
| ^
78+
| |
79+
| expected one of 8 possible tokens
80+
| help: missing `,`
81+
82+
error[E0425]: cannot find value `b` in this scope
83+
--> $DIR/issue-91461.rs:2:9
84+
|
85+
LL | a(_:b:,)
86+
| ^ not found in this scope
87+
88+
error: in expressions, `_` can only be used on the left-hand side of an assignment
89+
--> $DIR/issue-91461.rs:2:7
90+
|
91+
LL | a(_:b:,)
92+
| ^ `_` not allowed here
93+
94+
error[E0425]: cannot find function `a` in this scope
95+
--> $DIR/issue-91461.rs:2:5
96+
|
97+
LL | a(_:b:,)
98+
| ^ not found in this scope
99+
100+
error: aborting due to 8 previous errors
35101

102+
For more information about this error, try `rustc --explain E0425`.

tests/ui/parser/recover/recover-from-bad-variant.stderr

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ LL | let x = Enum::Foo(a: 3, b: 4);
1919
| expected one of 8 possible tokens
2020
| help: missing `,`
2121

22+
<<<<<<< HEAD
23+
=======
24+
error: expected one of `)` or `,`, found `3`
25+
--> $DIR/recover-from-bad-variant.rs:7:26
26+
|
27+
LL | let x = Enum::Foo(a: 3, b: 4);
28+
| -^ expected one of `)` or `,`
29+
| |
30+
| help: missing `,`
31+
32+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
2233
error: expected expression, found `:`
2334
--> $DIR/recover-from-bad-variant.rs:7:30
2435
|
@@ -40,6 +51,17 @@ LL | let x = Enum::Foo(a: 3, b: 4);
4051
| expected one of 8 possible tokens
4152
| help: missing `,`
4253

54+
<<<<<<< HEAD
55+
=======
56+
error: expected one of `)` or `,`, found `4`
57+
--> $DIR/recover-from-bad-variant.rs:7:32
58+
|
59+
LL | let x = Enum::Foo(a: 3, b: 4);
60+
| -^ expected one of `)` or `,`
61+
| |
62+
| help: missing `,`
63+
64+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
4365
error[E0425]: cannot find value `a` in this scope
4466
--> $DIR/recover-from-bad-variant.rs:7:23
4567
|
@@ -75,7 +97,11 @@ help: use the tuple variant pattern syntax instead
7597
LL | Enum::Bar(a, b) => {}
7698
| ~~~~~~
7799

100+
<<<<<<< HEAD
78101
error: aborting due to 9 previous errors
102+
=======
103+
error: aborting due to 11 previous errors
104+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
79105

80106
Some errors have detailed explanations: E0164, E0425, E0533, E0769.
81107
For more information about an error, try `rustc --explain E0164`.

tests/ui/type/type-ascription-precedence.stderr

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ help: if this is a parameter, remove the name for the parameter
1515
LL - *(S: Z);
1616
LL + *(Z);
1717
|
18+
<<<<<<< HEAD
19+
=======
20+
21+
error: expected one of `)` or `,`, found `Z`
22+
--> $DIR/type-ascription-precedence.rs:33:10
23+
|
24+
LL | *(S: Z);
25+
| -^ expected one of `)` or `,`
26+
| |
27+
| help: missing `,`
28+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
1829

1930
error: expected identifier, found `:`
2031
--> $DIR/type-ascription-precedence.rs:37:8
@@ -27,6 +38,17 @@ help: if this is a parameter, remove the name for the parameter
2738
LL - -(S: Z);
2839
LL + -(Z);
2940
|
41+
<<<<<<< HEAD
42+
=======
43+
44+
error: expected one of `)` or `,`, found `Z`
45+
--> $DIR/type-ascription-precedence.rs:37:10
46+
|
47+
LL | -(S: Z);
48+
| -^ expected one of `)` or `,`
49+
| |
50+
| help: missing `,`
51+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
3052

3153
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `:`
3254
--> $DIR/type-ascription-precedence.rs:41:12
@@ -54,11 +76,15 @@ error: expected one of `.`, `;`, `?`, `}`, or an operator, found `:`
5476
LL | (S .. S): S;
5577
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
5678

79+
<<<<<<< HEAD
5780
error[E0614]: type `Z` cannot be dereferenced
5881
--> $DIR/type-ascription-precedence.rs:33:5
5982
|
6083
LL | *(S: Z);
6184
| ^^^^^^^
85+
=======
86+
error: aborting due to 9 previous errors
87+
>>>>>>> a78747cc579d1299cf9a7941bd56ad9370a1a851
6288

6389
error[E0600]: cannot apply unary operator `-` to type `Z`
6490
--> $DIR/type-ascription-precedence.rs:37:5

0 commit comments

Comments
 (0)