Skip to content

Commit 4334a72

Browse files
committed
skip pointee correctly
1 parent eafd7a6 commit 4334a72

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/trait_impl_difference.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ impl<'tcx> Visitor<'tcx> for TypeParamSpanVisitor<'tcx> {
141141
match arg.kind {
142142
hir::TyKind::Ref(_, ref mut_ty) => {
143143
// We don't want to suggest looking into borrowing `&T` or `&Self`.
144-
hir::intravisit::walk_ty(self, mut_ty.ty);
144+
match mut_ty.ty.kind {
145+
hir::TyKind::Infer(()) => (),
146+
_ => hir::intravisit::walk_ambig_ty(self, mut_ty.ty.as_ambig_ty()),
147+
}
145148
return;
146149
}
147150
hir::TyKind::Path(hir::QPath::Resolved(None, path)) => match &path.segments {

0 commit comments

Comments
 (0)