Skip to content

Parser: Clean up parse_expr_dot_or_call_with & simplify parse_expr_prefix - #164537

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
fmease:parser-cleanup-prefix-op
Nov 23, 2026
Merged

rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
fmease:parser-cleanup-prefix-op

Conversation

@fmease

@fmease fmease commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

View all comments

(No LLM was or will be used by me during the entire creation process of this PR)

@rustbot 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 Oct 18, 2026
@rustbot

rustbot commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

r? @camelid

rustbot has assigned @camelid.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, parser
  • compiler, parser expanded to 77 candidates
  • Random selection from 20 candidates

@fmease fmease added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Oct 18, 2026
@fmease
fmease force-pushed the parser-cleanup-prefix-op branch from 1d66175 to b255bbd Compare October 18, 2026 21:28
@fmease

fmease commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 18, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 18, 2026
Parser: Clean up `parse_expr_dot_or_call_with` & simplify `parse_expr_prefix`
@rust-bors

rust-bors Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: bf712a5 (bf712a5851cabfcef6f5397f6ebe1eef0db3297b)
Base parent: 15c1044 (15c10447a46529b68e38c7f138aeb95240e4d7d6)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (bf712a5): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 3.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.7% [3.5%, 3.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary 0.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 490.17s -> 496.821s (1.36%)
Artifact size: 408.94 MiB -> 409.03 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 18, 2026
@fmease

fmease commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

(most likely spurious)

(I originally issued the perf run since I converted macro calls into function pointer calls)

@rust-bors

This comment has been minimized.

@fmease
fmease force-pushed the parser-cleanup-prefix-op branch from b255bbd to e3bd229 Compare November 3, 2026 13:25
@rustbot

This comment has been minimized.

@fmease

fmease commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

@rustbot reroll

@rustbot rustbot assigned Enselic and unassigned camelid Nov 23, 2026
@petrochenkov

Copy link
Copy Markdown
Contributor

@fmease feel free to assign parser cleanups to me, in general. (I'm busy on this week specifically, so not self-assigning right now.)

@fmease
fmease force-pushed the parser-cleanup-prefix-op branch from e3bd229 to 2a5fb21 Compare November 23, 2026 13:02
@rustbot

rustbot commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer

This comment has been minimized.

Don't artificially suppress the `.` & `?` expectation after `return`
that doesn't make any sense. `return.field` & `return?` are perfectly
legal. Moreover, this rather simplistic check didn't even account for any
of `return`'s "siblings" (`break`, `continue`, `yield`, `become`,
`do yeet`).
@fmease
fmease force-pushed the parser-cleanup-prefix-op branch from 2a5fb21 to b55c02d Compare November 23, 2026 13:15
@camelid

camelid commented Nov 23, 2026

Copy link
Copy Markdown
Member

Sorry for the delay on this. I actually started reviewing a couple of days ago. I will finish it today.

@camelid camelid assigned camelid and unassigned Enselic Nov 23, 2026

@camelid camelid left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

) -> Option<PResult<'a, Box<Expr>>> {
if self.may_recover() && self.eat_noexpect(&token::RArrow) {
self.dcx().emit_err(diagnostics::ExprRArrowCall { span: self.prev_token.span });
let base = Box::new(mem::replace(base, Expr::dummy()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't feel the cleanest but I can't think of a better approach given the need to handle Err cases too...

@camelid

camelid commented Nov 23, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit b55c02d has been approved by camelid

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Nov 23, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 23, 2026
…=camelid

Parser: Clean up `parse_expr_dot_or_call_with` & simplify `parse_expr_prefix`

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
@rust-bors

rust-bors Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

⌛ Testing commit b55c02d with merge 9323d88...

Workflow: https://github.com/rust-lang/rust/actions/runs/45248971301

rust-bors Bot pushed a commit that referenced this pull request Nov 23, 2026
Parser: Clean up `parse_expr_dot_or_call_with` & simplify `parse_expr_prefix`

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
@jhpratt

jhpratt commented Nov 23, 2026

Copy link
Copy Markdown
Member

@bors yield to rollup

@rust-bors

rust-bors Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #166415.

rust-bors Bot pushed a commit that referenced this pull request Nov 23, 2026
Rollup of 5 pull requests

Successful merges:

 - #164537 (Parser: Clean up `parse_expr_dot_or_call_with` & simplify `parse_expr_prefix`)
 - #165481 (Separate `Primitive::Bool` and make `#[repr($int)]` enums always use the ABI of $int)
 - #166290 (Require the next-solver for unsafe binders)
 - #165865 (Move more rustc lint attributes to lint helpers.)
 - #166221 (Unstably implement `StaticAllocator` on fundamental types)
@rust-bors
rust-bors Bot merged commit 79521fb into rust-lang:main Nov 23, 2026
14 of 15 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 23, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 23, 2026
Rollup merge of #164537 - fmease:parser-cleanup-prefix-op, r=camelid

Parser: Clean up `parse_expr_dot_or_call_with` & simplify `parse_expr_prefix`

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
@fmease
fmease deleted the parser-cleanup-prefix-op branch November 23, 2026 23:05
bjorn3 pushed a commit to rust-lang/rustc_codegen_cranelift that referenced this pull request Nov 24, 2026
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#164537 (Parser: Clean up `parse_expr_dot_or_call_with` & simplify `parse_expr_prefix`)
 - rust-lang/rust#165481 (Separate `Primitive::Bool` and make `#[repr($int)]` enums always use the ABI of $int)
 - rust-lang/rust#166290 (Require the next-solver for unsafe binders)
 - rust-lang/rust#165865 (Move more rustc lint attributes to lint helpers.)
 - rust-lang/rust#166221 (Unstably implement `StaticAllocator` on fundamental types)
mehmettoplu-rs pushed a commit to mehmettoplu-rs/miri that referenced this pull request Nov 24, 2026
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#164537 (Parser: Clean up `parse_expr_dot_or_call_with` & simplify `parse_expr_prefix`)
 - rust-lang/rust#165481 (Separate `Primitive::Bool` and make `#[repr($int)]` enums always use the ABI of $int)
 - rust-lang/rust#166290 (Require the next-solver for unsafe binders)
 - rust-lang/rust#165865 (Move more rustc lint attributes to lint helpers.)
 - rust-lang/rust#166221 (Unstably implement `StaticAllocator` on fundamental types)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cleanup Category: PRs that clean code up or issues documenting cleanup. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants