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

Corrects issue #28777 by removing, once a binary operator is found, the #30375

Merged
merged 4 commits into from
Dec 31, 2015

Conversation

aaronkeen
Copy link
Contributor

RESTRICTION_STMT_EXPR restriction to allow subsequent expressions to
contain braces.

#28777

… found, the

RESTRICTION_STMT_EXPR restriction to allow subsequent expressions to
contain braces.

rust-lang#28777
@alexcrichton
Copy link
Member

r? @eddyb (random @rust-lang/compiler selection)

Fixity::Right => self.with_res(restrictions, |this|{
this.parse_assoc_expr_with(op.precedence(), LhsExpr::NotYetParsed)
Fixity::Right => self.with_res(
restrictions & !Restrictions::RESTRICTION_STMT_EXPR,
Copy link
Member

Choose a reason for hiding this comment

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

This can be written as restrictions - Restrictions::RESTRICTION_STMT_EXPR, AFAIK.

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 are correct. I missed the support for - as set difference in bitflags. Thank you.

Changed bit manipulation to use supported - (set difference) instead
of explicit '& !'.
@eddyb
Copy link
Member

eddyb commented Dec 16, 2015

@bors r+

@bors
Copy link
Contributor

bors commented Dec 16, 2015

📌 Commit 41cc365 has been approved by eddyb

Manishearth added a commit to Manishearth/rust that referenced this pull request Dec 17, 2015
RESTRICTION_STMT_EXPR restriction to allow subsequent expressions to
contain braces.

rust-lang#28777
@mitaa
Copy link
Contributor

mitaa commented Dec 17, 2015

I guess parse-fail/assoc-oddities-3.rs should be removed?

@steveklabnik
Copy link
Member

@bors: r-

this failed the rollup

@aaronkeen
Copy link
Contributor Author

Yes, parse-fail/assoc-oddities-3.rs fails, as noted in #28777, because it is successfully parsed after this modification which is then consistent with grammar/parser-lalr. Please excuse my ignorance relating to this process, but it is not clear to me if I should remove that test as part of my PR or wait for a confirmation that this is the desired behavior (is grammar/parser-lalr considered the model?).

modification to parsing of binary operators.  This is consistent
with the behavior of grammar/parser-lalr.
@aaronkeen
Copy link
Contributor Author

Committed with test case removed.

run-pass.  Added run-pass/issue-28777 to demonstrate behavior of
this parsing modification.
@aaronkeen
Copy link
Contributor Author

The original parse-fail/assoc-oddities-3.rs test has been updated and moved to run-pass. An additional test has been added to run-pass to demonstrate that this modification successfully addresses the issue (this should have been done in the first place).

@nagisa
Copy link
Member

nagisa commented Dec 29, 2015

ping @eddyb r?

EDIT: @aaronkeen ah, by the way, that test was written by me to ensure my changes to associative operator parsing do not change behaviour of the previous parser (since the changes have been quite extensive). It is (or was), as name suggests, an oddity.

@eddyb
Copy link
Member

eddyb commented Dec 29, 2015

@bors r+

@bors
Copy link
Contributor

bors commented Dec 29, 2015

📌 Commit cedd794 has been approved by eddyb

@bors
Copy link
Contributor

bors commented Dec 30, 2015

⌛ Testing commit cedd794 with merge 37ff5c8...

@bors
Copy link
Contributor

bors commented Dec 30, 2015

💔 Test failed - auto-linux-64-opt

@aaronkeen
Copy link
Contributor Author

It seems the following tests timed out. I have examined the tests in code snippets in primitive-types and do not see any code that should have been perturbed by this PR. These tests all passed on my local machine [x86_64-apple-darwin], so I am not sure what the issue is. Is it possible to retrieve information regarding the specific test that failed (the execution order differs from the file and from my machine)?

run doc-book-primitive-types [x86_64-unknown-linux-gnu]

running 15 tests
test Booleans_0 ... ok
test Numeric_types_0 ... ok
test Arrays_0 ... ok
test Functions_0 ... ok
test Arrays_3 ... ok
test Arrays_1 ... ok
test Slices_0 ... ok
test Arrays_2 ... ok

command timed out: 1200 seconds without output running ['make', 'check'], attempting to kill
program finished with exit code 2
elapsedTime=2936.921062

@nagisa
Copy link
Member

nagisa commented Dec 30, 2015

@aaronkeen I believe the failure is spurious and a few retries should make it go away.

@aturon
Copy link
Member

aturon commented Dec 30, 2015

@bors: retry

@bors
Copy link
Contributor

bors commented Dec 30, 2015

⌛ Testing commit cedd794 with merge 2370d46...

bors added a commit that referenced this pull request Dec 30, 2015
RESTRICTION_STMT_EXPR restriction to allow subsequent expressions to
contain braces.

#28777
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.

8 participants