-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rustdoc: Sort implementors #53941
rustdoc: Sort implementors #53941
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
Sorry, it shouldn't have the submodules. The latest commit doesn't have them. |
Thanks! The lack of test is problematic though, but you can't really add one since the UI tests are still pending... Should we wait the merge of the UI tests PR @QuietMisdreavus? |
I'm fine with waiting #53319. |
Ping from triage @GuillaumeGomez: It looks like we won't be able to run the UI tests on CI soon. Do you still want to mark this PR as blocked on it? Otherwise, this PR requires your review. |
This is really problematic... Code seems good but we have no way to ensure that it won't break later in the future... If everyone's fine with that, then r=me. |
☔ The latest upstream changes (presumably #54146) made this pull request unmergeable. Please resolve the merge conflicts. |
How about adding tests under |
Let's go for this then... |
Testing something like "the first element in this list must be X" should fit into a Lines 67 to 97 in 994cdd9
I'd be okay with a test that did that. |
With such a test, it'd be as good as a UI one. Thanks for the head up @QuietMisdreavus! |
Hmm, is there a way to have the test file as std? pub trait MyIterator {
}
macro_rules! array_impls {
($($N:expr)+) => {
$(
impl<'a, T> MyIterator for &'a mut [T; $N] {
}
)+
}
}
array_impls! { 0 1 2 } The above is built as its own crate, which makes all MyIterator implementations as Implementations on Foreign Types. And the section somehow doesn't have this problem. In other words, I can't repro the issue in this test. |
Try using a wrapper type instead of plain arrays: pub trait MyIterator {
}
pub struct MyStruct<T>(T);
macro_rules! array_impls {
($($N:expr)+) => {
$(
impl<'a, T> MyIterator for MyStruct<&'a mut [T; $N]> {
}
)+
}
}
array_impls! { 0 1 2 } That should make rustdoc treat the implementation as on a local type. |
The way it defines implementations is unrealistic though.
} | ||
} | ||
|
||
// @has issue_53812/trait.MyIterator.html '//*[@id="implementors-list"]//h3[1]' 'MyStruct<[T; 0]>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check h3[2]
, h3[3]
and h3[4]
too. Like that we're sure it's not just luck.
Thanks! @bors: r+ rollup |
📌 Commit 2fe4503 has been approved by |
rustdoc: Sort implementors Fixes rust-lang#53812
Rollup of 5 pull requests Successful merges: - #53941 (rustdoc: Sort implementors) - #54181 (Suggest && and || instead of 'and' and 'or') - #54209 (Partially revert 674a5db "Fix undesirable fallout [from macro modularization]") - #54213 (De-overlap the lifetimes of `flow_inits` and `flow_{un,ever_}inits`.) - #54244 (Add a small search box to seach Rust's standary library) Failed merges: r? @ghost
Fixes #53812