Make portability part of the summary.
That means it will be visible under "Implementors" on trait pages, and under "Implementations" on struct/enum pages, even when all methods are collapsed. Switch to a float layout for rightside elements.
This commit is contained in:
parent
910c7fa767
commit
593d6d1cb1
4 changed files with 27 additions and 21 deletions
|
@ -1552,6 +1552,7 @@ fn render_impl(
|
|||
w,
|
||||
cx,
|
||||
i,
|
||||
parent,
|
||||
outer_version,
|
||||
outer_const_version,
|
||||
show_def_docs,
|
||||
|
@ -1562,11 +1563,6 @@ fn render_impl(
|
|||
if toggled {
|
||||
write!(w, "</summary>")
|
||||
}
|
||||
if trait_.is_some() {
|
||||
if let Some(portability) = portability(&i.impl_item, Some(parent)) {
|
||||
write!(w, "<div class=\"item-info\">{}</div>", portability);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(ref dox) = cx.shared.maybe_collapsed_doc_value(&i.impl_item) {
|
||||
let mut ids = cx.id_map.borrow_mut();
|
||||
|
@ -1598,6 +1594,7 @@ pub(crate) fn render_impl_summary(
|
|||
w: &mut Buffer,
|
||||
cx: &Context<'_>,
|
||||
i: &Impl,
|
||||
parent: &clean::Item,
|
||||
outer_version: Option<&str>,
|
||||
outer_const_version: Option<&str>,
|
||||
show_def_docs: bool,
|
||||
|
@ -1652,6 +1649,7 @@ pub(crate) fn render_impl_summary(
|
|||
);
|
||||
}
|
||||
write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
|
||||
write!(w, "<div class=\"rightside\">");
|
||||
render_stability_since_raw(
|
||||
w,
|
||||
i.impl_item.stable_since(tcx).as_deref(),
|
||||
|
@ -1660,6 +1658,15 @@ pub(crate) fn render_impl_summary(
|
|||
outer_const_version,
|
||||
);
|
||||
write_srclink(cx, &i.impl_item, w);
|
||||
w.write_str("</div>"); // end of "rightside"
|
||||
|
||||
let is_trait = i.inner_impl().trait_.is_some();
|
||||
if is_trait {
|
||||
if let Some(portability) = portability(&i.impl_item, Some(parent)) {
|
||||
write!(w, "<div class=\"item-info\">{}</div>", portability);
|
||||
}
|
||||
}
|
||||
|
||||
w.write_str("</div>");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue