about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBastian Kauschke <bastian_kauschke@hotmail.de>2020-10-04 22:48:57 +0200
committerBastian Kauschke <bastian_kauschke@hotmail.de>2020-10-07 10:19:04 +0200
commit8f13705e3b5cb563cee1c43446c0a682514a6f15 (patch)
tree1a6b892b9ccf9aed13b626b58ce96b90a86c4df9
parent5296ac656504883ef3432694ac3c5f3033255641 (diff)
downloadrust-8f13705e3b5cb563cee1c43446c0a682514a6f15.tar.gz
rust-8f13705e3b5cb563cee1c43446c0a682514a6f15.zip
fix def collector for impl trait
-rw-r--r--compiler/rustc_resolve/src/def_collector.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs
index 5d5088de31b..d7a1d30b0e4 100644
--- a/compiler/rustc_resolve/src/def_collector.rs
+++ b/compiler/rustc_resolve/src/def_collector.rs
@@ -239,13 +239,13 @@ impl<'a, 'b> visit::Visitor<'a> for DefCollector<'a, 'b> {
 
     fn visit_ty(&mut self, ty: &'a Ty) {
         match ty.kind {
-            TyKind::MacCall(..) => return self.visit_macro_invoc(ty.id),
+            TyKind::MacCall(..) => self.visit_macro_invoc(ty.id),
             TyKind::ImplTrait(node_id, _) => {
-                self.create_def(node_id, DefPathData::ImplTrait, ty.span);
+                let parent_def = self.create_def(node_id, DefPathData::ImplTrait, ty.span);
+                self.with_parent(parent_def, |this| visit::walk_ty(this, ty));
             }
-            _ => {}
+            _ => visit::walk_ty(self, ty),
         }
-        visit::walk_ty(self, ty);
     }
 
     fn visit_stmt(&mut self, stmt: &'a Stmt) {