Skip to content

Conversation

@lf-
Copy link
Contributor

@lf- lf- commented Aug 4, 2021

Fix #9779

@lf-
Copy link
Contributor Author

lf- commented Aug 4, 2021

Note: There are some more unstable range patterns that are not supported yet as well, for instance, ..=2 or such. I am just fixing the one that is getting stabilized in 1.55.

Copy link
Contributor

@matklad matklad left a comment

Choose a reason for hiding this comment

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

bors d+

p.bump(range_op);
atom_pat(p, recovery_set);
if !p.at(T![=>]) {
// not a range pat like `302 .. => ()`
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than leaving a comment here, better to split the tests:

if p.at(T![=>]) {
    // test half_open_range_pat
    // fn f() { let x .. = 1; }
} else {
    atom_pat(p, recovery_set);   
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You also found a bug with a test of that form! Fixed. Most likely would be seen in user code as if let 1.. = (...) which was not handled properly and is now.

@bors
Copy link
Contributor

bors bot commented Aug 4, 2021

✌️ lf- can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@lf-
Copy link
Contributor Author

lf- commented Aug 4, 2021

@bors r+

@Veykril
Copy link
Member

Veykril commented Aug 4, 2021

bors r=matklad

@Veykril
Copy link
Member

Veykril commented Aug 4, 2021

bors seems to have crashed earlier today so its stuck
bors r-
bors r=matklad

@lnicola

This comment has been minimized.

@bors
Copy link
Contributor

bors bot commented Aug 4, 2021

Already running a review

@bors
Copy link
Contributor

bors bot commented Aug 4, 2021

@bors bors bot merged commit 950efff into rust-lang:master Aug 4, 2021
@lnicola lnicola changed the title Support exclusive_range_pattern fix: Support exclusive_range_pattern Aug 4, 2021
bors bot added a commit to rust-analyzer/ungrammar that referenced this pull request Aug 13, 2021
37: Add both variants of half open range patterns to the grammar r=lf- a=lf-

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

Co-authored-by: Jade <software@lfcode.ca>
lnicola pushed a commit to lnicola/rust that referenced this pull request Nov 11, 2025
37: Add both variants of half open range patterns to the grammar r=lf- a=lf-

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

Co-authored-by: Jade <software@lfcode.ca>
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Nov 15, 2025
37: Add both variants of half open range patterns to the grammar r=lf- a=lf-

This is prompted by
rust-lang#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#9780

Co-authored-by: Jade <software@lfcode.ca>
lnicola pushed a commit to lnicola/rust that referenced this pull request Nov 15, 2025
37: Add both variants of half open range patterns to the grammar r=lf- a=lf-

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

Co-authored-by: Jade <software@lfcode.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive syntax error in range pattern

4 participants