")?;
// If there's already another implementor that has the same abbridged name, use the
// full path, for example in `std::iter::ExactSizeIterator`
- let use_absolute = match implementor.impl_.for_ {
+ let use_absolute = match implementor.inner_impl().for_ {
clean::ResolvedPath { ref path, is_generic: false, .. } |
clean::BorrowedRef {
type_: box clean::ResolvedPath { ref path, is_generic: false, .. },
@@ -2589,8 +2563,8 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
} => implementor_dups[path.last_name()].1,
_ => false,
};
- fmt_impl_for_trait_page(&implementor.impl_, w, use_absolute)?;
- for it in &implementor.impl_.items {
+ fmt_impl_for_trait_page(&implementor.inner_impl(), w, use_absolute)?;
+ for it in &implementor.inner_impl().items {
if let clean::TypedefItem(ref tydef, _) = it.inner {
write!(w, " ")?;
assoc_type(w, it, &vec![], Some(&tydef.type_), AssocItemLink::Anchor(None))?;
@@ -3880,20 +3854,16 @@ fn sidebar_trait(fmt: &mut fmt::Formatter, it: &clean::Item,
if let Some(implementors) = c.implementors.get(&it.def_id) {
let res = implementors.iter()
- .filter(|i| i.impl_.for_.def_id()
- .map_or(false, |d| !c.paths.contains_key(&d)))
+ .filter(|i| i.inner_impl().for_.def_id()
+ .map_or(false, |d| !c.paths.contains_key(&d)))
.filter_map(|i| {
- if let Some(item) = implementor2item(&c, i) {
- match extract_for_impl_name(&item) {
- Some((ref name, ref url)) => {
- Some(format!("{}",
- small_url_encode(url),
- Escape(name)))
- }
- _ => None,
+ match extract_for_impl_name(&i.impl_item) {
+ Some((ref name, ref url)) => {
+ Some(format!("{}",
+ small_url_encode(url),
+ Escape(name)))
}
- } else {
- None
+ _ => None,
}
})
.collect::();
diff --git a/src/test/rustdoc/issue-43893.rs b/src/test/rustdoc/issue-43893.rs
index 96bd9d7dc3cc5..a5e343ade3863 100644
--- a/src/test/rustdoc/issue-43893.rs
+++ b/src/test/rustdoc/issue-43893.rs
@@ -22,3 +22,8 @@ impl SomeTrait for usize {}
impl SomeTrait for SomeStruct {
// deliberately multi-line impl
}
+
+pub trait AnotherTrait {}
+
+// @has foo/trait.AnotherTrait.html '//a/@href' '../src/foo/issue-43893.rs.html#29'
+impl AnotherTrait for T {}