Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax: recover trailing | in or-patterns #64887

Merged
merged 1 commit into from
Oct 1, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Sep 29, 2019

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

@Centril Centril added the F-or_patterns `#![feature(or_patterns)]` label Sep 29, 2019
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 29, 2019
@Centril Centril force-pushed the recover-trailing-vert branch 2 times, most recently from 94dae1f to 66c5ad1 Compare September 29, 2019 04:45
@Centril Centril force-pushed the recover-trailing-vert branch 2 times, most recently from d4926a3 to 4a00342 Compare September 29, 2019 05:10
@Centril
Copy link
Contributor Author

Centril commented Sep 29, 2019

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

@estebank
Copy link
Contributor

estebank commented Oct 1, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Oct 1, 2019

📌 Commit 3eba6c1 has been approved by estebank

@bors bors 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

Fixes rust-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
Centril added a commit to Centril/rust that referenced this pull request Oct 1, 2019
…tebank

syntax: recover trailing `|` in or-patterns

Fixes rust-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
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:master Oct 1, 2019
@Centril Centril deleted the recover-trailing-vert branch October 1, 2019 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-or_patterns `#![feature(or_patterns)]` S-waiting-on-bors Status: 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