Skip to content

library: replace return types of constructors with Self#153496

Closed
xtqqczze wants to merge 2 commits intorust-lang:mainfrom
xtqqczze:ctor-self
Closed

library: replace return types of constructors with Self#153496
xtqqczze wants to merge 2 commits intorust-lang:mainfrom
xtqqczze:ctor-self

Conversation

@xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Mar 6, 2026

Fix some instances of clippy::use_self

@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 6, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 6, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, joboet

@xtqqczze xtqqczze changed the title std: change return types of constructors to Self std: replace return types of constructors with Self Mar 7, 2026
@xtqqczze xtqqczze changed the title std: replace return types of constructors with Self library: replace return types of constructors with Self Mar 8, 2026
@Mark-Simulacrum
Copy link
Member

Can you say more about the motivation for this change? It seems like unnecessary churn to me.

@xtqqczze
Copy link
Contributor Author

xtqqczze commented Mar 9, 2026

According to clippy::use_self it is: "Unnecessary repetition. Mixed use of Self and struct name feels inconsistent."

@Mark-Simulacrum
Copy link
Member

There's a reason that rule is allow-by-default even in clippy. I don't think this is worth the churn to run that lint. Thanks!

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-unix Operating system: Unix-like T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants