diff --git a/nac3core/src/toplevel/builtins.rs b/nac3core/src/toplevel/builtins.rs index 4405709..282c1a9 100644 --- a/nac3core/src/toplevel/builtins.rs +++ b/nac3core/src/toplevel/builtins.rs @@ -108,7 +108,7 @@ fn create_fn_by_codegen( name: &'static str, ret_ty: Type, param_ty: &[(Type, &'static str)], - codegen_callback: GenCallCallback, + codegen_callback: Box, ) -> Arc> { Arc::new(RwLock::new(TopLevelDef::Function { name: name.into(), diff --git a/nac3core/src/toplevel/mod.rs b/nac3core/src/toplevel/mod.rs index 1209f51..6edaeca 100644 --- a/nac3core/src/toplevel/mod.rs +++ b/nac3core/src/toplevel/mod.rs @@ -32,7 +32,7 @@ use type_annotation::*; #[cfg(test)] mod test; -type GenCallCallback = Box< +type GenCallCallback = dyn for<'ctx, 'a> Fn( &mut CodeGenContext<'ctx, 'a>, Option<(Type, ValueEnum<'ctx>)>, @@ -41,16 +41,15 @@ type GenCallCallback = Box< &mut dyn CodeGenerator, ) -> Result>, String> + Send - + Sync, ->; + + Sync; pub struct GenCall { - fp: GenCallCallback, + fp: Box, } impl GenCall { #[must_use] - pub fn new(fp: GenCallCallback) -> GenCall { + pub fn new(fp: Box) -> GenCall { GenCall { fp } }