Skip to content

Commit d442bf7

Browse files
committed
fixup! Don't visit foreign function bodies when lowering ast to hir
1 parent 0c64d32 commit d442bf7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc_ast_lowering/item.rs

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ impl<'a> Visitor<'a> for ItemLowerer<'a, '_, '_> {
8181
FnKind::Fn(FnCtxt::Foreign, _, sig, _, _) => {
8282
self.visit_fn_header(&sig.header);
8383
visit::walk_fn_decl(self, &sig.decl);
84+
// Don't visit the foreign function body even if it has one, since lowering the
85+
// body would have no meaning and will have already been caught as a parse error.
8486
}
8587
_ => visit::walk_fn(self, fk, sp),
8688
}

0 commit comments

Comments
 (0)