rustc_middle::ty::layout

Trait FnAbiOf

source
pub trait FnAbiOf<'tcx>: FnAbiOfHelpers<'tcx> {
    // Provided methods
    fn fn_abi_of_fn_ptr(
        &self,
        sig: PolyFnSig<'tcx>,
        extra_args: &'tcx List<Ty<'tcx>>,
    ) -> Self::FnAbiOfResult { ... }
    fn fn_abi_of_instance(
        &self,
        instance: Instance<'tcx>,
        extra_args: &'tcx List<Ty<'tcx>>,
    ) -> Self::FnAbiOfResult { ... }
}
Expand description

Blanket extension trait for contexts that can compute FnAbis.

Provided Methods§

source

fn fn_abi_of_fn_ptr( &self, sig: PolyFnSig<'tcx>, extra_args: &'tcx List<Ty<'tcx>>, ) -> Self::FnAbiOfResult

Compute a FnAbi suitable for indirect calls, i.e. to fn pointers.

NB: this doesn’t handle virtual calls - those should use fn_abi_of_instance instead, where the instance is an InstanceKind::Virtual.

source

fn fn_abi_of_instance( &self, instance: Instance<'tcx>, extra_args: &'tcx List<Ty<'tcx>>, ) -> Self::FnAbiOfResult

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 InstanceKind::Virtual instance (of <dyn Trait as Trait>::fn).

Implementors§

source§

impl<'tcx, C: FnAbiOfHelpers<'tcx>> FnAbiOf<'tcx> for C