|
1 | 1 | use std::ops::ControlFlow; |
2 | 2 |
|
3 | | -use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; |
| 3 | +use rustc_data_structures::fx::FxIndexSet; |
4 | 4 | use rustc_errors::codes::*; |
5 | 5 | use rustc_errors::struct_span_code_err; |
6 | 6 | use rustc_hir as hir; |
@@ -524,14 +524,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
524 | 524 | /// the `trait_ref` here will be `for<'a> T: Iterator`. |
525 | 525 | /// The `constraint` data however is from *inside* the binder |
526 | 526 | /// (e.g., `&'a u32`) and hence may reference bound regions. |
527 | | - #[instrument(level = "debug", skip(self, bounds, duplicates, path_span))] |
| 527 | + #[instrument(level = "debug", skip(self, bounds, path_span))] |
528 | 528 | pub(super) fn lower_assoc_item_constraint( |
529 | 529 | &self, |
530 | 530 | hir_ref_id: hir::HirId, |
531 | 531 | trait_ref: ty::PolyTraitRef<'tcx>, |
532 | 532 | constraint: &hir::AssocItemConstraint<'tcx>, |
533 | 533 | bounds: &mut Vec<(ty::Clause<'tcx>, Span)>, |
534 | | - duplicates: &mut FxIndexMap<DefId, Span>, |
535 | 534 | path_span: Span, |
536 | 535 | predicate_filter: PredicateFilter, |
537 | 536 | ) -> Result<(), ErrorGuaranteed> { |
@@ -587,18 +586,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
587 | 586 | ) |
588 | 587 | .expect("failed to find associated item"); |
589 | 588 |
|
590 | | - duplicates |
591 | | - .entry(assoc_item.def_id) |
592 | | - .and_modify(|prev_span| { |
593 | | - self.dcx().emit_err(errors::ValueOfAssociatedStructAlreadySpecified { |
594 | | - span: constraint.span, |
595 | | - prev_span: *prev_span, |
596 | | - item_name: constraint.ident, |
597 | | - def_path: tcx.def_path_str(assoc_item.container_id(tcx)), |
598 | | - }); |
599 | | - }) |
600 | | - .or_insert(constraint.span); |
601 | | - |
602 | 589 | let projection_term = if let ty::AssocTag::Fn = assoc_tag { |
603 | 590 | let bound_vars = tcx.late_bound_vars(constraint.hir_id); |
604 | 591 | ty::Binder::bind_with_vars( |
|
0 commit comments