Skip to content

Commit 8f13705

Browse files
committed
fix def collector for impl trait
1 parent 5296ac6 commit 8f13705

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_resolve/src/def_collector.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,13 @@ impl<'a, 'b> visit::Visitor<'a> for DefCollector<'a, 'b> {
239239

240240
fn visit_ty(&mut self, ty: &'a Ty) {
241241
match ty.kind {
242-
TyKind::MacCall(..) => return self.visit_macro_invoc(ty.id),
242+
TyKind::MacCall(..) => self.visit_macro_invoc(ty.id),
243243
TyKind::ImplTrait(node_id, _) => {
244-
self.create_def(node_id, DefPathData::ImplTrait, ty.span);
244+
let parent_def = self.create_def(node_id, DefPathData::ImplTrait, ty.span);
245+
self.with_parent(parent_def, |this| visit::walk_ty(this, ty));
245246
}
246-
_ => {}
247+
_ => visit::walk_ty(self, ty),
247248
}
248-
visit::walk_ty(self, ty);
249249
}
250250

251251
fn visit_stmt(&mut self, stmt: &'a Stmt) {

0 commit comments

Comments
 (0)