Skip to content

refactor(parse): separate self parameter parsing from general parameter parsing #145088

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

xonx4l
Copy link
Contributor

@xonx4l xonx4l commented Aug 8, 2025

Fixes #144206

The changes-:
Moves self parameter parsing out of parse_param_general and into parse_fn_params
for better separation of concerns. This removes the first_param boolean and its
branching logic while maintaining identical behavior.

Benefits:

  • Cleaner separation of concerns
  • Improved readability and testability
  • More maintainable code structure

No behavioral changes introduced.

@rustbot
Copy link
Collaborator

rustbot commented Aug 8, 2025

r? @nnethercote

rustbot has assigned @nnethercote.
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

@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 Aug 8, 2025
@rust-log-analyzer

This comment has been minimized.

params.push(self_param);
}

let (mut reamining_params, _) = self.parse_paren_comma_seq(|p| {
Copy link
Contributor

Choose a reason for hiding this comment

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

s/reamining_params/remaining_params/

@nnethercote
Copy link
Contributor

Please fix the errors, thanks!

@rustbot author

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 9, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 9, 2025
@rust-log-analyzer

This comment has been minimized.

@fmease
Copy link
Member

fmease commented Aug 9, 2025

(please also squash into one commit afterwards, thanks)

@rust-log-analyzer

This comment has been minimized.

@xonx4l
Copy link
Contributor Author

xonx4l commented Aug 13, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 13, 2025
@nnethercote
Copy link
Contributor

Still more CI failures to be fixed.

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 14, 2025
@bors
Copy link
Collaborator

bors commented Aug 15, 2025

☔ The latest upstream changes (presumably #145423) made this pull request unmergeable. Please resolve the merge conflicts.

@nnethercote
Copy link
Contributor

Sorry, I don't think this is a valid change. With the current code, the self param will be parsed within the self.collect_tokens() call in parse_param_general. This PR moves self parsing outside of the self.collect_tokens(), which means tokens will never be collected for it.

I understand your desire to clean this code up -- the first_param argument is clumsy. But I think it is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

Refactor: Split self-param logic from parse_param_general
6 participants