about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/impl_wf_check.rs
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-08-10 21:31:26 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2022-10-11 06:24:51 +0000
commit152cd6322655bb5173655cdf0781ca64c2a7602f (patch)
treebd3c5ca31c99c70fddcba8b7e57e31d68da14eac /compiler/rustc_hir_analysis/src/impl_wf_check.rs
parent8796e7a9cfd4c5c4f1de15ec1c53994ddf288665 (diff)
downloadrust-152cd6322655bb5173655cdf0781ca64c2a7602f.tar.gz
rust-152cd6322655bb5173655cdf0781ca64c2a7602f.zip
Report duplicate definitions in trait impls during resolution.
Diffstat (limited to 'compiler/rustc_hir_analysis/src/impl_wf_check.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/impl_wf_check.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/impl_wf_check.rs b/compiler/rustc_hir_analysis/src/impl_wf_check.rs
index c499364056f..69155a422b0 100644
--- a/compiler/rustc_hir_analysis/src/impl_wf_check.rs
+++ b/compiler/rustc_hir_analysis/src/impl_wf_check.rs
@@ -197,6 +197,9 @@ fn report_unused_parameter(tcx: TyCtxt<'_>, span: Span, kind: &str, name: Symbol
 
 /// Enforce that we do not have two items in an impl with the same name.
 fn enforce_impl_items_are_distinct(tcx: TyCtxt<'_>, impl_def_id: LocalDefId) {
+    if tcx.impl_trait_ref(impl_def_id).is_some() {
+        return;
+    }
     let mut seen_type_items = FxHashMap::default();
     let mut seen_value_items = FxHashMap::default();
     for &impl_item_ref in tcx.associated_item_def_ids(impl_def_id) {