Skip to content

Commit

Permalink
Rollup merge of rust-lang#53801 - GuillaumeGomez:duplicated-foreign-t…
Browse files Browse the repository at this point in the history
…ype-impls, r=QuietMisdreavus

Prevent duplicated impl on foreign types

Fixes rust-lang#53689.

r? @QuietMisdreavus
  • Loading branch information
kennytm authored Sep 1, 2018
2 parents 88ebbe9 + 3b98571 commit f370814
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 @@ -2956,12 +2956,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 f370814

Please sign in to comment.