-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustdoc: Remove Clean impls for tuples #91501
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
Conversation
This commit removes the first of nine Clean impls on tuples, converting it to a function instead. The fact that these are impls causes several problems: 1. They are nameless, so it's unclear what they do. 2. It's hard to find where they're used apart from removing them and seeing what errors occur (this applies to all Clean impls, not just the tuple ones). 3. Rustc doesn't currently warn when impls are unused, so dead code can accumulate easily (all Clean impls). 4. Their bodies often use tuple field indexing syntax (e.g., `self.1`) to refer to their "arguments", which makes reading the code more difficult. As I noted, some of these problems apply to all Clean impls, but even those problems are exacerbated by the tuple impls since they make general understanding of the code harder. Converting the impls to functions solves all four of these problems.
This was the last one!
This PR is best reviewed
|
I made sure each removal passed |
This is really great, thanks a lot for this clean up! @bors: r+ |
📌 Commit e36561d has been approved by |
Woups, didn't see that CI wasn't done yet. r=me once CI pass. @bors: r- |
@bors r=GuillaumeGomez |
📌 Commit e36561d has been approved by |
Could have tricky conflicts: @bors rollup=iffy |
☀️ Test successful - checks-actions |
Finished benchmarking commit (14c1e71): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
This PR removes all nine Clean impls on tuples, converting them to
functions instead.
The fact that these are impls causes several problems:
They are nameless, so it's unclear what they do.
It's hard to find where they're used apart from removing them and
seeing what errors occur (this applies to all Clean impls, not just
the tuple ones).
Rustc doesn't currently warn when impls are unused, so dead code
can accumulate easily (all Clean impls).
Their bodies often use tuple field indexing syntax (e.g.,
self.1
)to refer to their "arguments", which makes reading the code more
difficult.
As I noted, some of these problems apply to all Clean impls, but even
those problems are exacerbated by the tuple impls since they make
general understanding of the code harder.
Converting the impls to functions solves all four of these problems.
r? @GuillaumeGomez