Skip to content

Commit 7ea04d1

Browse files
Remove span hack that doesnt do anything
1 parent 0c6da32 commit 7ea04d1

File tree

1 file changed

+1
-30
lines changed
  • compiler/rustc_hir_analysis/src/hir_ty_lowering

1 file changed

+1
-30
lines changed

compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs

+1-30
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
716716
/// emit a generic note suggesting using a `where` clause to constraint instead.
717717
pub(crate) fn complain_about_missing_assoc_tys(
718718
&self,
719-
mut principal_span: Span,
719+
principal_span: Span,
720720
missing_assoc_types: FxIndexSet<DefId>,
721721
potential_assoc_types: Vec<usize>,
722722
trait_bounds: &[hir::PolyTraitRef<'_>],
@@ -759,35 +759,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
759759
hir::Node::Expr(_) | hir::Node::Pat(_) => true,
760760
_ => false,
761761
};
762-
match bound.trait_ref.path.segments {
763-
// FIXME: `trait_ref.path.span` can point to a full path with multiple
764-
// segments, even though `trait_ref.path.segments` is of length `1`. Work
765-
// around that bug here, even though it should be fixed elsewhere.
766-
// This would otherwise cause an invalid suggestion. For an example, look at
767-
// `tests/ui/issues/issue-28344.rs` where instead of the following:
768-
//
769-
// error[E0191]: the value of the associated type `Output`
770-
// (from trait `std::ops::BitXor`) must be specified
771-
// --> $DIR/issue-28344.rs:4:17
772-
// |
773-
// LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
774-
// | ^^^^^^ help: specify the associated type:
775-
// | `BitXor<Output = Type>`
776-
//
777-
// we would output:
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::bitor<Output = Type>`
786-
[segment] if segment.args.is_none() => {
787-
principal_span = segment.ident.span;
788-
}
789-
_ => {}
790-
}
791762
}
792763

793764
// We get all the associated items that _are_ set,

0 commit comments

Comments
 (0)