Skip to content

Commit b15360a

Browse files
committed
Do not walk multiple times.
1 parent 5a4b6dc commit b15360a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

compiler/rustc_middle/src/ty/diagnostics.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -507,13 +507,8 @@ impl<'v> hir::intravisit::Visitor<'v> for TraitObjectVisitor<'v> {
507507
..
508508
},
509509
_,
510-
) => {
511-
self.0.push(ty);
512-
}
513-
hir::TyKind::OpaqueDef(opaq, _, _) => {
514-
self.0.push(ty);
515-
hir::intravisit::walk_opaque_ty(self, opaq);
516-
}
510+
)
511+
| hir::TyKind::OpaqueDef(..) => self.0.push(ty),
517512
_ => {}
518513
}
519514
hir::intravisit::walk_ty(self, ty);

0 commit comments

Comments
 (0)