Skip to content

Commit

Permalink
Prevent duplicated impl on foreign types
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 29, 2018
1 parent 8785e34 commit 3b98571
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2943,12 +2943,16 @@ fn item_trait(
</h2>
")?;

let mut foreign_cache = FxHashSet();
for implementor in foreign {
let assoc_link = AssocItemLink::GotoSource(
implementor.impl_item.def_id, &implementor.inner_impl().provided_trait_methods
);
render_impl(w, cx, &implementor, assoc_link,
RenderMode::Normal, implementor.impl_item.stable_since(), false)?;
if foreign_cache.insert(implementor.inner_impl().to_string()) {
let assoc_link = AssocItemLink::GotoSource(
implementor.impl_item.def_id,
&implementor.inner_impl().provided_trait_methods
);
render_impl(w, cx, &implementor, assoc_link,
RenderMode::Normal, implementor.impl_item.stable_since(), false)?;
}
}
}

Expand Down

0 comments on commit 3b98571

Please sign in to comment.