Skip to content

Commit f370814

Browse files
authored
Rollup merge of #53801 - GuillaumeGomez:duplicated-foreign-type-impls, r=QuietMisdreavus
Prevent duplicated impl on foreign types Fixes #53689. r? @QuietMisdreavus
2 parents 88ebbe9 + 3b98571 commit f370814

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/librustdoc/html/render.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -2956,12 +2956,16 @@ fn item_trait(
29562956
</h2>
29572957
")?;
29582958

2959+
let mut foreign_cache = FxHashSet();
29592960
for implementor in foreign {
2960-
let assoc_link = AssocItemLink::GotoSource(
2961-
implementor.impl_item.def_id, &implementor.inner_impl().provided_trait_methods
2962-
);
2963-
render_impl(w, cx, &implementor, assoc_link,
2964-
RenderMode::Normal, implementor.impl_item.stable_since(), false)?;
2961+
if foreign_cache.insert(implementor.inner_impl().to_string()) {
2962+
let assoc_link = AssocItemLink::GotoSource(
2963+
implementor.impl_item.def_id,
2964+
&implementor.inner_impl().provided_trait_methods
2965+
);
2966+
render_impl(w, cx, &implementor, assoc_link,
2967+
RenderMode::Normal, implementor.impl_item.stable_since(), false)?;
2968+
}
29652969
}
29662970
}
29672971

0 commit comments

Comments
 (0)