Skip to content

Conversation

@ChayimFriedman2
Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 commented Aug 2, 2025

Closes #20352.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 2, 2025
result
}

fn transform_method_call_into_assoc_fn(
Copy link
Member

Choose a reason for hiding this comment

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

There should be code sharing potential here I think. We do have an assist to qualify method calls after all. Might be nice too look into that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to pursue that, but that was not easy. The code there handles more cases and also IMO needs a refactoring, it also dismisses some edges cases especially around macros, and fixing this isn't trivial. In short, while it'll be good to reuse the code, as the state of things is now it's not easy and there's no big overlap between the code. Even after I switched to use the qualify assist code it did not save much lines. So I think it's a good idea in general, but I don't want to block this PR over that.

Comment on lines 37 to 44
fn import_path_config(&self) -> ImportPathConfig {
ImportPathConfig {
prefer_no_std: self.prefer_no_std,
prefer_prelude: self.prefer_prelude,
prefer_absolute: self.prefer_absolute,
allow_unstable: true,
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Should rename config maybe just contain an ImportPathConfig? (and overwrite the allow_unstable field on construction)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AssistConfig and DiagnosticsConfig have separate fields, I just copied that.

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Oct 27, 2025
Merged via the queue into rust-lang:master with commit f7a13f0 Oct 27, 2025
15 checks passed
@ChayimFriedman2 ChayimFriedman2 deleted the rename-self2 branch October 27, 2025 15:47
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 27, 2025
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.

Renaming a method's self to something else does not fix callers' use of method syntax

3 participants