fixup! Don't visit foreign function bodies when lowering ast to hir

This commit is contained in:
Ayaz Hafiz 2020-07-15 17:22:41 -07:00
parent 0c64d32a4a
commit d442bf7162
No known key found for this signature in database
GPG key ID: B443F7A3030C9AED

View file

@ -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),
}