Trait rustc_trans::middle::ty::ClosureTyperUnstable [-] [+] [src]

pub trait ClosureTyper<'tcx> {
    fn param_env(&'a self) -> &'a ParameterEnvironment<'a, 'tcx>;
    fn closure_kind(&self, def_id: DefId) -> Option<ClosureKind>;
    fn closure_type(&self, def_id: DefId, substs: &Substs<'tcx>) -> ClosureTy<'tcx>;
    fn closure_upvars(&self, def_id: DefId, substs: &Substs<'tcx>) -> Option<Vec<ClosureUpvar<'tcx>>>;

    fn tcx(&self) -> &ctxt<'tcx> { ... }
}

Required Methods

fn param_env(&'a self) -> &'a ParameterEnvironment<'a, 'tcx>

fn closure_kind(&self, def_id: DefId) -> Option<ClosureKind>

Is this a Fn, FnMut or FnOnce closure? During typeck, returns None if the kind of this closure has not yet been inferred.

fn closure_type(&self, def_id: DefId, substs: &Substs<'tcx>) -> ClosureTy<'tcx>

Returns the argument/return types of this closure.

fn closure_upvars(&self, def_id: DefId, substs: &Substs<'tcx>) -> Option<Vec<ClosureUpvar<'tcx>>>

Returns the set of all upvars and their transformed types. During typeck, maybe return None if the upvar types have not yet been inferred.

Provided Methods

fn tcx(&self) -> &ctxt<'tcx>

Implementors