core: Remove Box from GenCallCallback type alias
So that references to the function type can be taken.
This commit is contained in:
parent
64a3751fc2
commit
d0766a116f
@ -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<GenCallCallback>,
|
||||
) -> Arc<RwLock<TopLevelDef>> {
|
||||
Arc::new(RwLock::new(TopLevelDef::Function {
|
||||
name: name.into(),
|
||||
|
@ -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<Option<BasicValueEnum<'ctx>>, String>
|
||||
+ Send
|
||||
+ Sync,
|
||||
>;
|
||||
+ Sync;
|
||||
|
||||
pub struct GenCall {
|
||||
fp: GenCallCallback,
|
||||
fp: Box<GenCallCallback>,
|
||||
}
|
||||
|
||||
impl GenCall {
|
||||
#[must_use]
|
||||
pub fn new(fp: GenCallCallback) -> GenCall {
|
||||
pub fn new(fp: Box<GenCallCallback>) -> GenCall {
|
||||
GenCall { fp }
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user