Skip to content

Commit 68aca3b

Browse files
committed
fixup! fixup! Don't visit foreign function bodies when lowering ast to hir
1 parent ab4275c commit 68aca3b

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/librustc_ast_lowering/item.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,13 @@ impl<'a> Visitor<'a> for ItemLowerer<'a, '_, '_> {
7777
}
7878
}
7979

80-
fn visit_fn(&mut self, fk: FnKind<'a>, _: Span, _: NodeId) {
80+
fn visit_fn(&mut self, fk: FnKind<'a>, sp: Span, _: NodeId) {
8181
match fk {
8282
FnKind::Fn(FnCtxt::Foreign, _, sig, _, _) => {
8383
self.visit_fn_header(&sig.header);
8484
visit::walk_fn_decl(self, &sig.decl);
8585
}
86-
FnKind::Fn(_, _, sig, _, body) => {
87-
self.visit_fn_header(&sig.header);
88-
visit::walk_fn_decl(self, &sig.decl);
89-
walk_list!(self, visit_block, body);
90-
}
91-
FnKind::Closure(decl, body) => {
92-
visit::walk_fn_decl(self, decl);
93-
self.visit_expr(body);
94-
}
86+
_ => visit::walk_fn(self, fk, sp),
9587
}
9688
}
9789

0 commit comments

Comments
 (0)