Type Alias PolyFnSig

Source
pub type PolyFnSig = Binder<FnSig>;

Aliased Type§

struct PolyFnSig {
    vars: Interned<[BoundVariableKind]>,
    value: FnSig,
}

Fields§

§vars: Interned<[BoundVariableKind]>§value: FnSig

Implementations§

Source§

impl PolyFnSig

Source

pub fn hoist_input_binders(&self) -> Self

Convert a function signature with existentials to one where they are all bound at the top level. Performs a transparent (i.e. not shallow) canonicalization. The uses the LocalHoister machinery to convert a function template without binders, e.g. fn ({v.i32 | *}) -> {v.i32|*}) into one with input binders, e.g. forall <a:int>. fn ({i32[a]|*}) -> {v.i32|*} after which the hole-filling machinery can be used to fill in the holes. This lets us get “dependent signatures” for closures, where the output can refer to the input. e.g. see tests/pos/surface/closure09.rs

Trait Implementations§

Source§

impl Pretty for PolyFnSig

Source§

fn fmt(&self, cx: &PrettyCx<'_, '_>, f: &mut Formatter<'_>) -> Result

Source§

fn default_cx(tcx: TyCtxt<'_>) -> PrettyCx<'_, '_>