Trait rustc_middle::ty::layout::FnAbiExt [−][src]
pub trait FnAbiExt<'tcx, C> where
C: LayoutOf<'tcx, LayoutOfResult = TyAndLayout<'tcx>> + HasTargetSpec, {
fn of_fn_ptr(cx: &C, sig: PolyFnSig<'tcx>, extra_args: &[Ty<'tcx>]) -> Self;
fn of_instance(
cx: &C,
instance: Instance<'tcx>,
extra_args: &[Ty<'tcx>]
) -> Self;
fn new_internal(
cx: &C,
sig: PolyFnSig<'tcx>,
extra_args: &[Ty<'tcx>],
caller_location: Option<Ty<'tcx>>,
codegen_fn_attr_flags: CodegenFnAttrFlags,
make_self_ptr_thin: bool
) -> Self;
fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi);
}Required methods
Compute a FnAbi suitable for indirect calls, i.e. to fn pointers.
NB: this doesn’t handle virtual calls - those should use FnAbi::of_instance
instead, where the instance is an InstanceDef::Virtual.
Compute a FnAbi suitable for declaring/defining an fn instance, and for
direct calls to an fn.
NB: that includes virtual calls, which are represented by “direct calls”
to an InstanceDef::Virtual instance (of <dyn Trait as Trait>::fn).