Skip to content

Commit

Permalink
fixup! Don't visit foreign function bodies when lowering ast to hir
Browse files Browse the repository at this point in the history
  • Loading branch information
ayazhafiz committed Jul 16, 2020
1 parent 0c64d32 commit d442bf7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustc_ast_lowering/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ impl<'a> Visitor<'a> for ItemLowerer<'a, '_, '_> {
FnKind::Fn(FnCtxt::Foreign, _, sig, _, _) => {
self.visit_fn_header(&sig.header);
visit::walk_fn_decl(self, &sig.decl);
// Don't visit the foreign function body even if it has one, since lowering the
// body would have no meaning and will have already been caught as a parse error.
}
_ => visit::walk_fn(self, fk, sp),
}
Expand Down

0 comments on commit d442bf7

Please sign in to comment.