pub trait LoadConstantFn<'a, H: ?Sized, CC: CustomConst + ?Sized>: for<'c> Fn(&mut EmitFuncContext<'c, 'a, H>, &CC) -> Result<BasicValueEnum<'c>> + 'a { }
Expand description
A helper trait for describing the callback used for emitting CustomConsts,
and for hanging documentation. We have the appropriate Fn
as a supertrait,
and there is a blanket impl for that Fn
. We do not intend users to impl
this trait.
LoadConstantFn
callbacks for CC
, which must impl CustomConst, should
materialise an appropriate BasicValueEnum. The type of this value must
match the result of EmitFuncContext::llvm_type on CustomConst::get_type.
Callbacks may hold references with lifetimes older than 'a
.