|
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; |
@@ -418,14 +418,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
418 | 418 | /// the `trait_ref` here will be `for<'a> T: Iterator`. |
419 | 419 | /// The `constraint` data however is from *inside* the binder |
420 | 420 | /// (e.g., `&'a u32`) and hence may reference bound regions. |
421 | | - #[instrument(level = "debug", skip(self, bounds, duplicates, path_span))] |
| 421 | + #[instrument(level = "debug", skip(self, bounds, path_span))] |
422 | 422 | pub(super) fn lower_assoc_item_constraint( |
423 | 423 | &self, |
424 | 424 | hir_ref_id: hir::HirId, |
425 | 425 | trait_ref: ty::PolyTraitRef<'tcx>, |
426 | 426 | constraint: &hir::AssocItemConstraint<'tcx>, |
427 | 427 | bounds: &mut Vec<(ty::Clause<'tcx>, Span)>, |
428 | | - duplicates: &mut FxIndexMap<DefId, Span>, |
429 | 428 | path_span: Span, |
430 | 429 | predicate_filter: PredicateFilter, |
431 | 430 | ) -> Result<(), ErrorGuaranteed> { |
@@ -481,18 +480,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
481 | 480 | ) |
482 | 481 | .expect("failed to find associated item"); |
483 | 482 |
|
484 | | - duplicates |
485 | | - .entry(assoc_item.def_id) |
486 | | - .and_modify(|prev_span| { |
487 | | - self.dcx().emit_err(errors::ValueOfAssociatedStructAlreadySpecified { |
488 | | - span: constraint.span, |
489 | | - prev_span: *prev_span, |
490 | | - item_name: constraint.ident, |
491 | | - def_path: tcx.def_path_str(assoc_item.container_id(tcx)), |
492 | | - }); |
493 | | - }) |
494 | | - .or_insert(constraint.span); |
495 | | - |
496 | 483 | let projection_term = if let ty::AssocTag::Fn = assoc_tag { |
497 | 484 | let bound_vars = tcx.late_bound_vars(constraint.hir_id); |
498 | 485 | ty::Binder::bind_with_vars( |
|
0 commit comments