You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[rustdoc] Implementors section of Sync (and other similar traits) should separate implementors and !implementors #51129
Would it work out if the impls were just sorted apart, rather than giving an entirely new section heading to "negative impls"? That might be easier to implement.
All the collections it's partitioning at the start of that contain render::Impl structs, and you can see whether it's a !impl by checking the "polarity" of the clean::Impl it contains. You can check implementor.impl_item().polarity and compare it against Some(clean::ImplPolarity::Negative), and sort these collections before iterating (or partition them farther, heh) to print one before the other. Given the nature of Send and Sync, i think it would be better to print the negative impls before the positive ones.
@QuietMisdreavus Yes, the instructions were very helpful! I have it to a point where it is sorting with negative implementors showing first. One question I have is outside of the polarity does the order of implementors need to be preserved?
@SLaabsDev That's probably best addressed by all of @rust-lang/docs but what i would say is "don't worry about it", since we currently don't do a very good job of keeping that ordering in the first place. This could be a good place to enforce a good ordering, but you don't have to do that in your PR. (If you asking to choose between sort and sort_unstable, go ahead and pick sort just so we don't disrupt the current ordering too much.)
changed the title [-][docs] Implementors section of Sync (and other similar traits) should separate implementors and !implementors[/-][+][rustdoc] Implementors section of Sync (and other similar traits) should separate implementors and !implementors[/+]on Nov 26, 2020
Activity
QuietMisdreavus commentedon Jun 14, 2018
Would it work out if the impls were just sorted apart, rather than giving an entirely new section heading to "negative impls"? That might be easier to implement.
alex commentedon Jun 14, 2018
@QuietMisdreavus yes, just sorted seperately would be A+
QuietMisdreavus commentedon Jun 14, 2018
Excellent!
Some mentoring instructions:
The code that displays all these impls is right here:
rust/src/librustdoc/html/render.rs
Lines 2860 to 2900 in 5205ae8
All the collections it's partitioning at the start of that contain
render::Implstructs, and you can see whether it's a!implby checking the "polarity" of theclean::Implit contains. You can checkimplementor.impl_item().polarityand compare it againstSome(clean::ImplPolarity::Negative), and sort these collections before iterating (or partition them farther, heh) to print one before the other. Given the nature ofSendandSync, i think it would be better to print the negative impls before the positive ones.SLaabsDev commentedon Jun 22, 2018
I can start on this one
QuietMisdreavus commentedon Jun 23, 2018
@SLaabsDev Thanks! Were the instructions i gave a good start? If you need any help, please ask me!
SLaabsDev commentedon Jun 26, 2018
@QuietMisdreavus Yes, the instructions were very helpful! I have it to a point where it is sorting with negative implementors showing first. One question I have is outside of the polarity does the order of implementors need to be preserved?
QuietMisdreavus commentedon Jul 3, 2018
@SLaabsDev That's probably best addressed by all of @rust-lang/docs but what i would say is "don't worry about it", since we currently don't do a very good job of keeping that ordering in the first place. This could be a good place to enforce a good ordering, but you don't have to do that in your PR. (If you asking to choose between
sortandsort_unstable, go ahead and picksortjust so we don't disrupt the current ordering too much.)[-][docs] Implementors section of Sync (and other similar traits) should separate implementors and !implementors[/-][+][rustdoc] Implementors section of Sync (and other similar traits) should separate implementors and !implementors[/+]hkBst commentedon Feb 7, 2025
Any update here?
GuillaumeGomez commentedon Feb 7, 2025
Still in progress.
GuillaumeGomez commentedon Jun 11, 2025
Opened #142380.
alex commentedon Jun 11, 2025
Thanks for looking at this after all these years!
GuillaumeGomez commentedon Jun 11, 2025
If you're patient enough, everything (hopefully) will be done at some point. 😆
Rollup merge of rust-lang#142380 - GuillaumeGomez:neg-implementors, r…
Rollup merge of rust-lang#142380 - GuillaumeGomez:neg-implementors, r…
Rollup merge of rust-lang#142380 - GuillaumeGomez:neg-implementors, r…
Unrolled build for #142380
Rollup merge of #142380 - GuillaumeGomez:neg-implementors, r=yotamofek