@@ -727,7 +727,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
727
727
let tcx = self.tcx();
728
728
// FIXME: Marked `mut` so that we can replace the spans further below with a more
729
729
// appropriate one, but this should be handled earlier in the span assignment.
730
- let mut associated_types: FxIndexMap<Span, Vec<_>> = associated_types
730
+ let associated_types: FxIndexMap<Span, Vec<_>> = associated_types
731
731
.into_iter()
732
732
.map(|(span, def_ids)| {
733
733
(span, def_ids.into_iter().map(|did| tcx.associated_item(did)).collect())
@@ -769,39 +769,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
769
769
hir::Node::Expr(_) | hir::Node::Pat(_) => true,
770
770
_ => false,
771
771
};
772
- match bound.trait_ref.path.segments {
773
- // FIXME: `trait_ref.path.span` can point to a full path with multiple
774
- // segments, even though `trait_ref.path.segments` is of length `1`. Work
775
- // around that bug here, even though it should be fixed elsewhere.
776
- // This would otherwise cause an invalid suggestion. For an example, look at
777
- // `tests/ui/issues/issue-28344.rs` where instead of the following:
778
- //
779
- // error[E0191]: the value of the associated type `Output`
780
- // (from trait `std::ops::BitXor`) must be specified
781
- // --> $DIR/issue-28344.rs:4:17
782
- // |
783
- // LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
784
- // | ^^^^^^ help: specify the associated type:
785
- // | `BitXor<Output = Type>`
786
- //
787
- // we would output:
788
- //
789
- // error[E0191]: the value of the associated type `Output`
790
- // (from trait `std::ops::BitXor`) must be specified
791
- // --> $DIR/issue-28344.rs:4:17
792
- // |
793
- // LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
794
- // | ^^^^^^^^^^^^^ help: specify the associated type:
795
- // | `BitXor::bitor<Output = Type>`
796
- [segment] if segment.args.is_none() => {
797
- trait_bound_spans = vec![segment.ident.span];
798
- associated_types = associated_types
799
- .into_values()
800
- .map(|items| (segment.ident.span, items))
801
- .collect();
802
- }
803
- _ => {}
804
- }
805
772
}
806
773
807
774
// We get all the associated items that _are_ set,
0 commit comments