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.