Skip to content

Commit 1a0997b

Browse files
author
Joshua Nelson
authored
Rollup merge of rust-lang#83826 - slightlyoutofphase:rustdoc-sidebar-order-shuffle, r=jyn514
List trait impls before deref methods in doc's sidebar This PR is acting directly on a suggestion made by ``````@jyn514`````` in rust-lang#83133. I've tested the changes locally, and can confirm that it does in fact properly achieve what he thought it would. This PR also in turn closes rust-lang#83133.
2 parents 8b56beb + 72502e8 commit 1a0997b

File tree

1 file changed

+8
-7
lines changed
  • src/librustdoc/html/render

1 file changed

+8
-7
lines changed

src/librustdoc/html/render/mod.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -1915,13 +1915,6 @@ fn sidebar_assoc_items(cx: &Context<'_>, out: &mut Buffer, it: &clean::Item) {
19151915
}
19161916

19171917
if v.iter().any(|i| i.inner_impl().trait_.is_some()) {
1918-
if let Some(impl_) = v
1919-
.iter()
1920-
.filter(|i| i.inner_impl().trait_.is_some())
1921-
.find(|i| i.inner_impl().trait_.def_id_full(cache) == cx.cache.deref_trait_did)
1922-
{
1923-
sidebar_deref_methods(cx, out, impl_, v);
1924-
}
19251918
let format_impls = |impls: Vec<&Impl>| {
19261919
let mut links = FxHashSet::default();
19271920

@@ -1989,6 +1982,14 @@ fn sidebar_assoc_items(cx: &Context<'_>, out: &mut Buffer, it: &clean::Item) {
19891982
);
19901983
write_sidebar_links(out, blanket_format);
19911984
}
1985+
1986+
if let Some(impl_) = v
1987+
.iter()
1988+
.filter(|i| i.inner_impl().trait_.is_some())
1989+
.find(|i| i.inner_impl().trait_.def_id_full(cache) == cx.cache.deref_trait_did)
1990+
{
1991+
sidebar_deref_methods(cx, out, impl_, v);
1992+
}
19921993
}
19931994
}
19941995
}

0 commit comments

Comments
 (0)