Struct rustc::middle::mem_categorization::MemCategorizationContext
[−]
[src]
pub struct MemCategorizationContext<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
pub infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,
}rustc_private)Fields
infcx: &'a InferCtxt<'a, 'gcx, 'tcx>
rustc_private)Methods
impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx>[src]
fn new(infcx: &'a InferCtxt<'a, 'gcx, 'tcx>) -> MemCategorizationContext<'a, 'gcx, 'tcx>
fn cat_expr(&self, expr: &Expr) -> McResult<cmt<'tcx>>
fn cat_expr_autoderefd(&self, expr: &Expr, autoderefs: usize) -> McResult<cmt<'tcx>>
fn cat_expr_unadjusted(&self, expr: &Expr) -> McResult<cmt<'tcx>>
fn cat_def(&self, id: NodeId, span: Span, expr_ty: Ty<'tcx>, def: Def) -> McResult<cmt<'tcx>>
fn temporary_scope(&self, id: NodeId) -> Region
rustc_private)Returns the lifetime of a temporary created by expr with id id.
This could be 'static if id is part of a constant expression.
fn cat_rvalue_node(&self, id: NodeId, span: Span, expr_ty: Ty<'tcx>) -> cmt<'tcx>
fn cat_rvalue(&self, cmt_id: NodeId, span: Span, temp_scope: Region, expr_ty: Ty<'tcx>) -> cmt<'tcx>
fn cat_field<N: ast_node>(&self, node: &N, base_cmt: cmt<'tcx>, f_name: Name, f_ty: Ty<'tcx>) -> cmt<'tcx>
fn cat_tup_field<N: ast_node>(&self, node: &N, base_cmt: cmt<'tcx>, f_idx: usize, f_ty: Ty<'tcx>) -> cmt<'tcx>
fn cat_index<N: ast_node>(&self, elt: &N, base_cmt: cmt<'tcx>, context: InteriorOffsetKind) -> McResult<cmt<'tcx>>
rustc_private)Creates a cmt for an indexing operation ([]).
One subtle aspect of indexing that may not be
immediately obvious: for anything other than a fixed-length
vector, an operation like x[y] actually consists of two
disjoint (from the point of view of borrowck) operations.
The first is a deref of x to create a pointer p that points
at the first element in the array. The second operation is
an index which adds y*sizeof(T) to p to obtain the
pointer to x[y]. cat_index will produce a resulting
cmt containing both this deref and the indexing,
presuming that base_cmt is not of fixed-length type.
Parameters
elt: the AST node being indexedbase_cmt: the cmt ofelt
fn cat_slice_pattern(&self, vec_cmt: cmt<'tcx>, slice_pat: &Pat) -> McResult<(cmt<'tcx>, Mutability, Region)>
rustc_private)Given a pattern P like: [_, ..Q, _], where vec_cmt is the cmt for P, slice_pat is
the pattern Q, returns:
- a cmt for
Q - the mutability and region of the slice
Q
These last two bits of info happen to be things that borrowck needs.
fn cat_imm_interior<N: ast_node>(&self, node: &N, base_cmt: cmt<'tcx>, interior_ty: Ty<'tcx>, interior: InteriorKind) -> cmt<'tcx>
fn cat_downcast<N: ast_node>(&self, node: &N, base_cmt: cmt<'tcx>, downcast_ty: Ty<'tcx>, variant_did: DefId) -> cmt<'tcx>
fn cat_pattern<F>(&self, cmt: cmt<'tcx>, pat: &Pat, op: F) -> McResult<()> where F: FnMut(&MemCategorizationContext<'a, 'gcx, 'tcx>, cmt<'tcx>, &Pat)
Trait Implementations
Derived Implementations
impl<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> Clone for MemCategorizationContext<'a, 'gcx, 'tcx>[src]
fn clone(&self) -> MemCategorizationContext<'a, 'gcx, 'tcx>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more