flag the function as inline after checking style

Signed-off-by: Jakub Doka <jakub.doka2@gmail.com>
This commit is contained in:
Jakub Doka 2024-12-16 14:04:30 +01:00
parent 1571938e9f
commit 8bf2d1a266
No known key found for this signature in database
GPG key ID: C6E9A89936B8C143

View file

@ -4582,8 +4582,6 @@ impl<'a> Codegen<'a> {
let ast = &self.files[file]; let ast = &self.files[file];
let &Expr::Closure { args: cargs, body, .. } = expr.get(ast) else { unreachable!() }; let &Expr::Closure { args: cargs, body, .. } = expr.get(ast) else { unreachable!() };
inline |= sig.ret == ty::Id::TYPE;
let arg_count = args.len() + caller.is_some() as usize; let arg_count = args.len() + caller.is_some() as usize;
if arg_count != cargs.len() { if arg_count != cargs.len() {
self.error( self.error(
@ -4604,6 +4602,8 @@ impl<'a> Codegen<'a> {
); );
} }
inline |= sig.ret == ty::Id::TYPE;
let (mut tys, mut args, mut cargs) = (sig.args.args(), args.iter(), cargs.iter()); let (mut tys, mut args, mut cargs) = (sig.args.args(), args.iter(), cargs.iter());
if is_inline || inline { if is_inline || inline {
let var_base = self.ci.scope.vars.len(); let var_base = self.ci.scope.vars.len();