make main always pub

This commit is contained in:
Edgar 2024-02-17 17:31:13 +01:00
parent ff0b6fb995
commit 2d69bf095a
No known key found for this signature in database
GPG key ID: 70ADAE8F35904387

View file

@ -93,7 +93,7 @@ fn lower_function(ctx: BuildCtx, func: &ast::Function, module_id: DefId) -> Buil
let body = ctx.body.modules.get(&module_id).unwrap(); let body = ctx.body.modules.get(&module_id).unwrap();
*body.symbols.functions.get(&func.name.name).unwrap() *body.symbols.functions.get(&func.name.name).unwrap()
}, },
is_pub: func.is_public, is_pub: func.is_public || func.name.name == "main",
is_extern: func.is_extern, is_extern: func.is_extern,
fn_span: func.span, fn_span: func.span,
}, },