Rollup merge of #53801 - GuillaumeGomez:duplicated-foreign-type-impls, r=QuietMisdreavus

Prevent duplicated impl on foreign types

Fixes #53689.

r? @QuietMisdreavus
This commit is contained in:
kennytm 2018-09-01 21:14:15 +08:00 committed by GitHub
commit f37081499b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2956,14 +2956,18 @@ fn item_trait(
</h2>
")?;
let mut foreign_cache = FxHashSet();
for implementor in foreign {
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
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)?;
}
}
}
write!(w, "{}", impl_header)?;
for implementor in concrete {