Skip to content

syntax: recover trailing | in or-patterns - #64887

Merged
bors merged 1 commit into
rust-lang:masterfrom
Centril:recover-trailing-vert
Oct 1, 2019
Merged

syntax: recover trailing | in or-patterns#64887
bors merged 1 commit into
rust-lang:masterfrom
Centril:recover-trailing-vert

Conversation

@Centril

Copy link
Copy Markdown
Contributor

Fixes#64879.

For example (this also shows that we are sensitive to the typo ||):

error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:33:11
|
LL | A || => {}
| - ^^ help: remove the `||`
| |
| while parsing this or-pattern starting here
|
= note: alternatives in or-patterns are separated with `|`, not `||`

r? @estebank

@CentrilCentril added the F-or_patterns `#![feature(or_patterns)]` label Sep 29, 2019
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 29, 2019
@Centril
Centrilforce-pushed the recover-trailing-vert branch 2 times, most recently from 94dae1f to 66c5ad1CompareSeptember 29, 2019 04:45
Comment threadsrc/libsyntax/parse/parser/pat.rs Outdated
@Centril
Centrilforce-pushed the recover-trailing-vert branch 2 times, most recently from d4926a3 to 4a00342CompareSeptember 29, 2019 05:10
@Centril

Copy link
Copy Markdown
ContributorAuthor

Added token::Colon as well for type ascription and improved the test coverage.

@Centril
Centrilforce-pushed the recover-trailing-vert branch from 4a00342 to 3eba6c1CompareSeptember 29, 2019 05:11
@estebank

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Oct 1, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 3eba6c1 has been approved by estebank

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 1, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 1, 2019
…tebank
syntax: recover trailing `|` in or-patterns
Fixesrust-lang#64879.
For example (this also shows that we are sensitive to the typo `||`):
```
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:33:11
|
LL | A || => {}
| - ^^ help: remove the `||`
| |
| while parsing this or-pattern starting here
|
= note: alternatives in or-patterns are separated with `|`, not `||`
```
r? @estebank
@CentrilCentril mentioned this pull request Oct 1, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 1, 2019
…tebank
syntax: recover trailing `|` in or-patterns
Fixesrust-lang#64879.
For example (this also shows that we are sensitive to the typo `||`):
```
error: a trailing `|` is not allowed in an or-pattern
--> $DIR/remove-leading-vert.rs:33:11
|
LL | A || => {}
| - ^^ help: remove the `||`
| |
| while parsing this or-pattern starting here
|
= note: alternatives in or-patterns are separated with `|`, not `||`
```
r? @estebank
@CentrilCentril mentioned this pull request Oct 1, 2019
bors added a commit that referenced this pull request Oct 1, 2019
Rollup of 10 pull requests
Successful merges:
- #63674 (syntax: Support modern attribute syntax in the `meta` matcher)
- #63931 (Stabilize macros in some more positions)
- #64887 (syntax: recover trailing `|` in or-patterns)
- #64895 (async/await: improve not-send errors)
- #64896 (Remove legacy grammar)
- #64907 (A small amount of tidying-up factored out from PR #64648)
- #64928 (Add tests for some issues)
- #64930 (Silence unreachable code lint from await desugaring)
- #64935 (Improve code clarity)
- #64937 (Deduplicate closure type errors)
Failed merges:
r? @ghost
@bors
bors merged commit 3eba6c1 into rust-lang:masterOct 1, 2019
@Centril
Centril deleted the recover-trailing-vert branch October 1, 2019 11:55
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-or_patterns`#![feature(or_patterns)]`S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect match arm guard preceded by | in the parser

4 participants

@Centril@estebank@bors@rust-highfive