-
Notifications
You must be signed in to change notification settings - Fork 12.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
Some parser improvements #127806
Merged
Merged
Some parser improvements #127806
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It has a single call site, it isn't that big, and its name is confusingly similar to `Parser::parse_item_common`.
Put `attrs` before `e0` because that matches the order in the source code, where outer attributes appear before expressions.
It has a single call site. Removing it removes the need for an `ExprKind` check. The commit also clarifies the relevant comment.
It only has two call sites, and it extremely similar to `Parser::parse_expr_dot_or_call_with`, in both name and behaviour. The only difference is the latter has an `attrs` argument and an `ensure_sufficient_stack` call. We can pass in an empty `attrs` as necessary, as is already done at some `parse_expr_dot_or_call_with` call sites.
It was removed in rust-lang#126571.
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Jul 16, 2024
r? @spastorino |
I added a couple more commits. |
nnethercote
force-pushed
the
parser-improvements
branch
from
July 17, 2024 05:49
2ed280d
to
9c4f3db
Compare
@bors r+ rollup |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jul 17, 2024
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jul 17, 2024
…=spastorino Some parser improvements I was looking closely at attribute handling in the parser while debugging some issues relating to rust-lang#124141, and found a few small improvements. `@spastorino`
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 18, 2024
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#127542 ([`macro_metavar_expr_concat`] Add support for literals) - rust-lang#127652 (Unignore cg_gcc fmt) - rust-lang#127664 (Fix precise capturing suggestion for hidden regions when we have APITs) - rust-lang#127806 (Some parser improvements) - rust-lang#127828 (Commonize `uname -m` results for `aarch64` in docker runner) - rust-lang#127845 (unix: break `stack_overflow::install_main_guard` into smaller fn) - rust-lang#127854 (Add internal lint for detecting non-glob imports of `rustc_type_ir::inherent`) - rust-lang#127861 (Document the column numbers for the dbg! macro) - rust-lang#127875 (style-guide: Clarify version-sorting) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 18, 2024
Rollup of 9 pull requests Successful merges: - rust-lang#127542 ([`macro_metavar_expr_concat`] Add support for literals) - rust-lang#127652 (Unignore cg_gcc fmt) - rust-lang#127664 (Fix precise capturing suggestion for hidden regions when we have APITs) - rust-lang#127806 (Some parser improvements) - rust-lang#127828 (Commonize `uname -m` results for `aarch64` in docker runner) - rust-lang#127845 (unix: break `stack_overflow::install_main_guard` into smaller fn) - rust-lang#127859 (ptr::metadata: avoid references to extern types) - rust-lang#127861 (Document the column numbers for the dbg! macro) - rust-lang#127875 (style-guide: Clarify version-sorting) r? `@ghost` `@rustbot` modify labels: rollup
tgross35
added a commit
to tgross35/rust
that referenced
this pull request
Jul 18, 2024
…=spastorino Some parser improvements I was looking closely at attribute handling in the parser while debugging some issues relating to rust-lang#124141, and found a few small improvements. ```@spastorino```
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 18, 2024
Rollup of 9 pull requests Successful merges: - rust-lang#127077 (Make language around `ToOwned` for `BorrowedFd` more precise) - rust-lang#127523 (Migrate `dump-ice-to-disk` and `panic-abort-eh_frame` `run-make` tests to rmake) - rust-lang#127787 (Migrate `atomic-lock-free` to `rmake`) - rust-lang#127806 (Some parser improvements) - rust-lang#127810 (Rename `tcx` to `cx` in `rustc_type_ir`) - rust-lang#127878 (Fix associated item removal suggestion) - rust-lang#127886 (Accurate `use` rename suggestion span) - rust-lang#127888 (More accurate span for type parameter suggestion) - rust-lang#127889 (More accurate span for anonymous argument suggestion) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 18, 2024
Rollup merge of rust-lang#127806 - nnethercote:parser-improvements, r=spastorino Some parser improvements I was looking closely at attribute handling in the parser while debugging some issues relating to rust-lang#124141, and found a few small improvements. ``@spastorino``
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was looking closely at attribute handling in the parser while debugging some issues relating to #124141, and found a few small improvements.
@spastorino