1
Fork 0

Simplify rustdoc handling of type aliases for associated types

The logic was very hard to follow before.
This commit is contained in:
Joshua Nelson 2021-01-03 15:38:46 -05:00
parent 18d27b2c94
commit a786eaac1f
5 changed files with 37 additions and 31 deletions

View file

@ -4308,6 +4308,7 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
.filter(|i| i.inner_impl().trait_.is_some())
.find(|i| i.inner_impl().trait_.def_id() == c.deref_trait_did)
{
debug!("found Deref: {:?}", impl_);
if let Some((target, real_target)) =
impl_.inner_impl().items.iter().find_map(|item| match *item.kind {
clean::TypedefItem(ref t, true) => Some(match *t {
@ -4317,6 +4318,7 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
_ => None,
})
{
debug!("found target, real_target: {:?} {:?}", target, real_target);
let deref_mut = v
.iter()
.filter(|i| i.inner_impl().trait_.is_some())
@ -4328,6 +4330,7 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
.and_then(|prim| c.primitive_locations.get(&prim).cloned()))
.and_then(|did| c.impls.get(&did));
if let Some(impls) = inner_impl {
debug!("found inner_impl: {:?}", impls);
out.push_str("<a class=\"sidebar-title\" href=\"#deref-methods\">");
out.push_str(&format!(
"Methods from {}&lt;Target={}&gt;",