Struct rustc_trans::middle::typeck::check::regionck::RcxExperimental [-]  [+] [src]

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

Methods

impl<'a, 'tcx> Rcx<'a, 'tcx>

fn new(fcx: &'a FnCtxt<'a, 'tcx>, initial_repeating_scope: u32) -> Rcx<'a, 'tcx>

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

fn set_repeating_scope(&mut self, scope: u32) -> u32

fn resolve_type(&self, unresolved_ty: &'tcx TyS<'tcx>) -> &'tcx TyS<'tcx>

Try to resolve the type for the given node, returning t_err if an error results. Note that we never care about the details of the error, the same error will be detected and reported in the writeback phase.

Note one important point: we do not attempt to resolve region variables here. This is because regionck is essentially adding constraints to those region variables and so may yet influence how they are resolved.

Consider this silly example:

fn borrow(x: &int) -> &int {x}
fn foo(x: @int) -> int {  // block: B
    let b = borrow(x);    // region: <R0>
    *b
}

Here, the region of b will be <R0>. <R0> is constrainted to be some subregion of the block B and some superregion of the call. If we forced it now, we'd choose the smaller region (the call). But that would make the *b illegal. Since we don't resolve, the type of b will be &<R0>.int and then *b will require that <R0> be bigger than the let and the *b expression, so we will effectively resolve <R0> to be the block B.

fn resolve_expr_type_adjusted(&mut self, expr: &Expr) -> &'tcx TyS<'tcx>

Try to resolve the type for the given node.

Trait Implementations

impl<'fcx, 'tcx> Typer<'tcx> for Rcx<'fcx, 'tcx>

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

fn node_ty(&self, id: u32) -> Result<&'tcx TyS<'tcx>, ()>

fn node_method_ty(&self, method_call: MethodCall) -> Option<&'tcx TyS<'tcx>>

fn adjustments(&'a self) -> &'a RefCell<HashMap<u32, AutoAdjustment<'tcx>, FnvHasher>>

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

fn temporary_scope(&self, id: u32) -> Option<CodeExtent>

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

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

fn unboxed_closures(&'a self) -> &'a RefCell<HashMap<DefId, UnboxedClosure<'tcx>, FnvHasher>>

impl<'a, 'tcx, 'v> Visitor<'v> for Rcx<'a, 'tcx>

fn visit_fn(&mut self, _fk: FnKind<'v>, _fd: &'v FnDecl, b: &'v Block, _s: Span, id: u32)

fn visit_item(&mut self, i: &Item)

fn visit_expr(&mut self, ex: &Expr)

fn visit_arm(&mut self, a: &Arm)

fn visit_local(&mut self, l: &Local)

fn visit_block(&mut self, b: &Block)

fn visit_name(&mut self, Span, Name)

fn visit_ident(&mut self, Span, Ident)

fn visit_mod(&mut self, &'v Mod, Span, u32)

fn visit_view_item(&mut self, &'v ViewItem)

fn visit_foreign_item(&mut self, &'v ForeignItem)

fn visit_item(&mut self, &'v Item)

fn visit_local(&mut self, &'v Local)

fn visit_block(&mut self, &'v Block)

fn visit_stmt(&mut self, &'v Spanned<Stmt_>)

fn visit_arm(&mut self, &'v Arm)

fn visit_pat(&mut self, &'v Pat)

fn visit_decl(&mut self, &'v Spanned<Decl_>)

fn visit_expr(&mut self, &'v Expr)

fn visit_expr_post(&mut self, &'v Expr)

fn visit_ty(&mut self, &'v Ty)

fn visit_generics(&mut self, &'v Generics)

fn visit_fn(&mut self, FnKind<'v>, &'v FnDecl, &'v Block, Span, u32)

fn visit_ty_method(&mut self, &'v TypeMethod)

fn visit_trait_item(&mut self, &'v TraitItem)

fn visit_trait_ref(&mut self, &'v TraitRef)

fn visit_ty_param_bound(&mut self, &'v TyParamBound)

fn visit_poly_trait_ref(&mut self, &'v PolyTraitRef)

fn visit_struct_def(&mut self, &'v StructDef, Ident, &'v Generics, u32)

fn visit_struct_field(&mut self, &'v Spanned<StructField_>)

fn visit_variant(&mut self, &'v Spanned<Variant_>, &'v Generics)

fn visit_opt_lifetime_ref(&mut self, Span, &'v Option<Lifetime>)

fn visit_lifetime_ref(&mut self, &'v Lifetime)

fn visit_lifetime_def(&mut self, &'v LifetimeDef)

fn visit_explicit_self(&mut self, &'v Spanned<ExplicitSelf_>)

fn visit_mac(&mut self, &'v Spanned<Mac_>)

fn visit_path(&mut self, &'v Path, u32)

fn visit_path_segment(&mut self, Span, &'v PathSegment)

fn visit_path_parameters(&mut self, Span, &'v PathParameters)

fn visit_attribute(&mut self, &'v Spanned<Attribute_>)