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

fix: box_syntax/pattern #1414

Merged
merged 2 commits into from
Jun 19, 2019
Merged

fix: box_syntax/pattern #1414

merged 2 commits into from
Jun 19, 2019

Conversation

csmoe
Copy link
Member

@csmoe csmoe commented Jun 19, 2019

Closes #1412
r? @matklad

Change-Id: I6e20e0163fa545de37226c1561b3b7103615626c
Change-Id: I45a856d74fb616d3bce33050f9e69d327186bd59
@matklad
Copy link
Member

matklad commented Jun 19, 2019

bors r+

Thanks!

bors bot added a commit that referenced this pull request Jun 19, 2019
1414: fix: box_syntax/pattern r=matklad a=csmoe

Closes #1412 
r? @matklad 

Co-authored-by: csmoe <csmoe@msn.com>
@bors
Copy link
Contributor

bors bot commented Jun 19, 2019

Build succeeded

@bors bors bot merged commit d653399 into rust-lang:master Jun 19, 2019
@Robbepop
Copy link
Contributor

Robbepop commented Jun 19, 2019

Does this PR also introduce box syntax in the way of matching them by box patterns?
I fail to see a test for this.
Something like this:
https://github.com/Robbepop/stevia/blob/master/simplifier/src/simplifications/bool_symbolic_solver.rs#L52

@matklad
Copy link
Member

matklad commented Jun 19, 2019 via email

@Robbepop
Copy link
Contributor

Ah got it, didn't notice it was covered by that! Thanks. :)

// fn foo() {
// let x = box 1i32;
// }
fn box_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
Copy link
Member Author

Choose a reason for hiding this comment

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

@matklad oops...did I miss something in this method? box syntax inside "tuple"s cannot be parsed.

struct Foo(Box<i32>);
let a = Foo(box 1i32);
let b = (box 1i32, box 2i32);

@matklad
Copy link
Member

matklad commented Jul 5, 2019 via email

bors bot added a commit that referenced this pull request Aug 22, 2019
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>
bors bot added a commit that referenced this pull request Aug 22, 2019
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>
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.

box_syntax/pattern not supported
4 participants