Struct rustc::middle::typeck::check::FnCtxtExperimental [-]  [+] [src]

pub struct FnCtxt<'a, 'tcx> {
    // some fields omitted
}

Methods

impl<'a, 'tcx> FnCtxt<'a, 'tcx>

fn infcx<'b>(&'b self) -> &'b InferCtxt<'a, 'tcx>

fn sess(&self) -> &Session

fn err_count_since_creation(&self) -> uint

impl<'a, 'tcx> FnCtxt<'a, 'tcx>

fn tag(&self) -> String

fn local_ty(&self, span: Span, nid: NodeId) -> t

fn default_diverging_type_variables_to_nil(&self)

fn write_ty(&self, node_id: NodeId, ty: t)

fn write_object_cast(&self, key: NodeId, trait_ref: Rc<TraitRef>)

fn write_substs(&self, node_id: NodeId, substs: ItemSubsts)

fn write_ty_substs(&self, node_id: NodeId, ty: t, substs: ItemSubsts)

fn write_autoderef_adjustment(&self, node_id: NodeId, span: Span, derefs: uint)

fn write_adjustment(&self, node_id: NodeId, span: Span, adj: AutoAdjustment)

fn instantiate_item_type(&self, span: Span, def_id: DefId) -> TypeAndSubsts

Returns the type of def_id with all generics replaced by by fresh type/region variables. Also returns the substitution from the type parameters on def_id to the fresh variables. Registers any trait obligations specified on def_id at the same time.

fn write_nil(&self, node_id: NodeId)

fn write_error(&self, node_id: NodeId)

fn require_type_meets(&self, ty: t, span: Span, code: ObligationCauseCode, bound: BuiltinBound)

fn require_type_is_sized(&self, ty: t, span: Span, code: ObligationCauseCode)

fn require_expr_have_sized_type(&self, expr: &Expr, code: ObligationCauseCode)

fn register_obligation(&self, obligation: Obligation)

fn to_ty(&self, ast_t: &Ty) -> t

fn pat_to_string(&self, pat: &Pat) -> String

fn expr_ty(&self, ex: &Expr) -> t

fn expr_ty_adjusted(&self, expr: &Expr) -> t

Fetch type of expr after applying adjustments that have been recorded in the fcx.

fn adjust_expr_ty(&self, expr: &Expr, adjustment: Option<&AutoAdjustment>) -> t

Apply adjustment to the type of expr

fn node_ty(&self, id: NodeId) -> t

fn item_substs<'a>(&'a self) -> Ref<'a, NodeMap<ItemSubsts>>

fn opt_node_ty_substs(&self, id: NodeId, f: |&ItemSubsts|)

fn mk_subty(&self, a_is_expected: bool, origin: TypeOrigin, sub: t, sup: t) -> Result<(), type_err>

fn can_mk_subty(&self, sub: t, sup: t) -> Result<(), type_err>

fn can_mk_eqty(&self, sub: t, sup: t) -> Result<(), type_err>

fn mk_assignty(&self, expr: &Expr, sub: t, sup: t) -> Result<(), type_err>

fn mk_eqty(&self, a_is_expected: bool, origin: TypeOrigin, sub: t, sup: t) -> Result<(), type_err>

fn mk_subr(&self, origin: SubregionOrigin, sub: Region, sup: Region)

fn type_error_message(&self, sp: Span, mk_msg: |String| -> String, actual_ty: t, err: Option<&type_err>)

fn report_mismatched_types(&self, sp: Span, e: t, a: t, err: &type_err)

fn register_region_obligation(&self, origin: SubregionOrigin, ty: t, r: Region)

Registers an obligation for checking later, during regionck, that the type ty must outlive the region r.

fn add_obligations_for_parameters(&self, cause: ObligationCause, substs: &Substs, generics: &Generics)

Given a set of generic parameter definitions (generics) and the values provided for each of them (substs), creates and registers suitable region obligations.

For example, if there is a function:

fn foo<'a,T:'a>(...)

and a reference:

let f = foo;

Then we will create a fresh region variable '$0 and a fresh type variable $1 for 'a and T. This routine will add a region obligation $1:'$0 and register it locally.

Trait Implementations

impl<'a, 'tcx> Typer<'tcx> for FnCtxt<'a, 'tcx>

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

fn node_ty(&self, id: NodeId) -> McResult<t>

fn node_method_ty(&self, method_call: MethodCall) -> Option<t>

fn adjustments<'a>(&'a self) -> &'a RefCell<NodeMap<AutoAdjustment>>

fn is_method_call(&self, id: NodeId) -> bool

fn temporary_scope(&self, rvalue_id: NodeId) -> Option<NodeId>

fn upvar_borrow(&self, upvar_id: UpvarId) -> UpvarBorrow

fn capture_mode(&self, closure_expr_id: NodeId) -> CaptureClause

fn unboxed_closures<'a>(&'a self) -> &'a RefCell<DefIdMap<UnboxedClosure>>

impl<'a, 'tcx> AstConv<'tcx> for FnCtxt<'a, 'tcx>

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

fn get_item_ty(&self, id: DefId) -> Polytype

fn get_trait_def(&self, id: DefId) -> Rc<TraitDef>

fn ty_infer(&self, _span: Span) -> t

fn associated_types_of_trait_are_valid(&self, _: t, _: DefId) -> bool

fn associated_type_binding(&self, span: Span, _: Option<t>, _: DefId, _: DefId) -> t

Derived Implementations

impl<'a, 'tcx> Clone for FnCtxt<'a, 'tcx>

fn clone(&self) -> FnCtxt<'a, 'tcx>

fn clone_from(&mut self, source: &Self)