Prevent duplicated impl on foreign types
This commit is contained in:
parent
8785e348ba
commit
3b98571b32
1 changed files with 9 additions and 5 deletions
|
@ -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)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue