Struct rustc::middle::typeck::check::regionck::Rcx[src]
pub struct Rcx<'a> {
// some fields omitted
}Methods
impl<'a> Rcx<'a>
fn tcx(&self) -> &'a ctxt
fn set_repeating_scope(&mut self, scope: NodeId) -> NodeId
fn resolve_type(&self, unresolved_ty: t) -> t
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) -> t
Try to resolve the type for the given node.