Extern fns are implicitly unsafe

closes #4865
This commit is contained in:
Aleksey Kladov 2020-07-11 21:53:32 +02:00
parent 00c81f8006
commit 66e2266d04

View file

@ -546,6 +546,7 @@ impl Ctx {
let id: ModItem = match item {
ast::ExternItem::FnDef(ast) => {
let func = self.lower_function(&ast)?;
self.data().functions[func.index].is_unsafe = true;
func.into()
}
ast::ExternItem::StaticDef(ast) => {