-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Parse box
keyword in patterns below top-level
#1722
Conversation
Looks like |
@matklad This does indeed fix the problem. Is there a way to bless parser test output? |
THhere's a magical |
26c0eac
to
b78c8cc
Compare
box
keyword in patterns below top-level
bors r+ Thanks! |
1722: Parse `box` keyword in patterns below top-level r=matklad a=ecstatic-morse This extends the parser to handle patterns like `if let Some(box x) = ...` where the `box` keyword is not at the top-level. The last line of the added test caused a `ParseError`. This is a variant of #1412 which was not fixed by #1414. ~~I'm not familiar with `rust-analyzer`, otherwise I would fix this as well 😄.~~ Co-authored-by: Dylan MacKenzie <ecstaticmorse@gmail.com>
Build failed |
b78c8cc
to
3e14b16
Compare
Oops, forgot to include the changes to the inline test as well. Should be ready to go once travis is green. |
bors r+ No need to wait for travis when we have bors! |
1722: Parse `box` keyword in patterns below top-level r=matklad a=ecstatic-morse This extends the parser to handle patterns like `if let Some(box x) = ...` where the `box` keyword is not at the top-level. The last line of the added test caused a `ParseError`. This is a variant of #1412 which was not fixed by #1414. ~~I'm not familiar with `rust-analyzer`, otherwise I would fix this as well 😄.~~ Co-authored-by: Dylan MacKenzie <ecstaticmorse@gmail.com>
Build succeeded |
Ugh, apparently this doesn't fix cases where a box pattern appears in conjunction with a struct or enum pattern like |
Hm, yeah, |
Okay, I'll look into this. It might take longer than an hour though 😃 |
This extends the parser to handle patterns like
if let Some(box x) = ...
where thebox
keyword is not at the top-level. The last line of the added test caused aParseError
. This is a variant of #1412 which was not fixed by #1414.I'm not familiar withrust-analyzer
, otherwise I would fix this as well 😄.