Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Continue evaluating after finding incorrect .. in pattern
- Loading branch information
Showing
5 changed files
with
42 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
fn main() { | ||
match 0 { | ||
(pat, ..,) => {} //~ ERROR trailing comma is not permitted after `..` | ||
(pat, ..,) => {} | ||
//~^ ERROR trailing comma is not permitted after `..` | ||
//~| ERROR mismatched types | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
error: trailing comma is not permitted after `..` | ||
--> $DIR/pat-tuple-2.rs:3:17 | ||
| | ||
LL | (pat, ..,) => {} //~ ERROR trailing comma is not permitted after `..` | ||
| ^ | ||
LL | (pat, ..,) => {} | ||
| ^ trailing comma is not permitted after `..` | ||
|
||
error: aborting due to previous error | ||
error[E0308]: mismatched types | ||
--> $DIR/pat-tuple-2.rs:3:9 | ||
| | ||
LL | (pat, ..,) => {} | ||
| ^^^^^^^^^^ expected integer, found tuple | ||
| | ||
= note: expected type `{integer}` | ||
found type `(_,)` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
fn main() { | ||
match 0 { | ||
(.., pat, ..) => {} //~ ERROR `..` can only be used once per tuple or tuple struct pattern | ||
(.., pat, ..) => {} | ||
//~^ ERROR `..` can only be used once per tuple or tuple struct pattern | ||
//~| ERROR mismatched types | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
error: `..` can only be used once per tuple or tuple struct pattern | ||
--> $DIR/pat-tuple-3.rs:3:19 | ||
| | ||
LL | (.., pat, ..) => {} //~ ERROR `..` can only be used once per tuple or tuple struct pattern | ||
| ^^ | ||
LL | (.., pat, ..) => {} | ||
| ^^ can only be used once per pattern | ||
|
||
error: aborting due to previous error | ||
error[E0308]: mismatched types | ||
--> $DIR/pat-tuple-3.rs:3:9 | ||
| | ||
LL | (.., pat, ..) => {} | ||
| ^^^^^^^^^^^^^ expected integer, found tuple | ||
| | ||
= note: expected type `{integer}` | ||
found type `(_,)` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |