Skip to content
This repository was archived by the owner on Nov 9, 2025. It is now read-only.

Conversation

@lf-
Copy link
Contributor

@lf- lf- commented Aug 4, 2021

This is prompted by
rust-lang/rust-analyzer#9779, but it
is not actually a prerequisite of making that one happen as this commit
doesn't change the generated code on the r-a side.

Relevant PR (that does not require this one be merged immediately/a release made): rust-lang/rust-analyzer#9780

// 1..2
| start:Pat op:('..' | '..=') end:Pat
// ..2
| op:('..' | '..=') end:Pat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fold this into the same case, like we did for RangeExpr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are slightly semantically different: what I wrote here is 1..2 or 1.. or ..2 but not ... rustc will syntax error if you put .., although it will tell you what you did wrong:

error: `..` patterns are not allowed here
 --> src/main.rs:3:9
  |
3 |         .. => 4,
  |         ^^
  |
  = note: only allowed in tuple, tuple struct, and slice patterns

@matklad
Copy link
Contributor

matklad commented Aug 4, 2021

could you also bump version in Cargo.toml to get this released?

lf- added 2 commits August 12, 2021 19:11
This is prompted by
rust-lang/rust-analyzer#9779, but it
is not actually a prerequisite of making that one happen as this commit
doesn't change the generated code on the r-a side.
@lf-
Copy link
Contributor Author

lf- commented Aug 13, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Aug 13, 2021

Build succeeded:

@bors bors bot merged commit 1c7a5c8 into rust-analyzer:master Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants