Struct rustc_lint::middle::mem_categorization::MemCategorizationContext
[−]
[src]
pub struct MemCategorizationContext<'a, 'gcx, 'tcx> where 'gcx: 'a,
'gcx: 'tcx,
'tcx: 'a {
pub infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,
// some fields omitted
}
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>
-> MemCategorizationContext<'a, 'gcx, 'tcx>
rustc_private
)fn with_options(infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,
options: MemCategorizationOptions)
-> MemCategorizationContext<'a, 'gcx, 'tcx>
options: MemCategorizationOptions)
-> MemCategorizationContext<'a, 'gcx, 'tcx>
rustc_private
)fn cat_expr(&self, expr: &Expr) -> Result<Rc<cmt_<'tcx>>, ()>
rustc_private
)fn cat_expr_autoderefd(&self,
expr: &Expr,
autoderefs: usize)
-> Result<Rc<cmt_<'tcx>>, ()>
expr: &Expr,
autoderefs: usize)
-> Result<Rc<cmt_<'tcx>>, ()>
rustc_private
)fn cat_expr_unadjusted(&self, expr: &Expr) -> Result<Rc<cmt_<'tcx>>, ()>
rustc_private
)fn cat_def(&self,
id: NodeId,
span: Span,
expr_ty: &'tcx TyS<'tcx>,
def: Def)
-> Result<Rc<cmt_<'tcx>>, ()>
id: NodeId,
span: Span,
expr_ty: &'tcx TyS<'tcx>,
def: Def)
-> Result<Rc<cmt_<'tcx>>, ()>
rustc_private
)fn temporary_scope(&self, id: NodeId) -> (&'tcx Region, &'tcx 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: &'tcx TyS<'tcx>)
-> Rc<cmt_<'tcx>>
id: NodeId,
span: Span,
expr_ty: &'tcx TyS<'tcx>)
-> Rc<cmt_<'tcx>>
rustc_private
)fn cat_rvalue(&self,
cmt_id: NodeId,
span: Span,
temp_scope: &'tcx Region,
old_temp_scope: &'tcx Region,
expr_ty: &'tcx TyS<'tcx>)
-> Rc<cmt_<'tcx>>
cmt_id: NodeId,
span: Span,
temp_scope: &'tcx Region,
old_temp_scope: &'tcx Region,
expr_ty: &'tcx TyS<'tcx>)
-> Rc<cmt_<'tcx>>
rustc_private
)fn cat_field<N>(&self,
node: &N,
base_cmt: Rc<cmt_<'tcx>>,
f_name: Symbol,
f_ty: &'tcx TyS<'tcx>)
-> Rc<cmt_<'tcx>> where N: ast_node
node: &N,
base_cmt: Rc<cmt_<'tcx>>,
f_name: Symbol,
f_ty: &'tcx TyS<'tcx>)
-> Rc<cmt_<'tcx>> where N: ast_node
rustc_private
)fn cat_tup_field<N>(&self,
node: &N,
base_cmt: Rc<cmt_<'tcx>>,
f_idx: usize,
f_ty: &'tcx TyS<'tcx>)
-> Rc<cmt_<'tcx>> where N: ast_node
node: &N,
base_cmt: Rc<cmt_<'tcx>>,
f_idx: usize,
f_ty: &'tcx TyS<'tcx>)
-> Rc<cmt_<'tcx>> where N: ast_node
rustc_private
)fn cat_index<N>(&self,
elt: &N,
base_cmt: Rc<cmt_<'tcx>>,
context: InteriorOffsetKind)
-> Result<Rc<cmt_<'tcx>>, ()> where N: ast_node
elt: &N,
base_cmt: Rc<cmt_<'tcx>>,
context: InteriorOffsetKind)
-> Result<Rc<cmt_<'tcx>>, ()> where N: ast_node
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_imm_interior<N>(&self,
node: &N,
base_cmt: Rc<cmt_<'tcx>>,
interior_ty: &'tcx TyS<'tcx>,
interior: InteriorKind)
-> Rc<cmt_<'tcx>> where N: ast_node
node: &N,
base_cmt: Rc<cmt_<'tcx>>,
interior_ty: &'tcx TyS<'tcx>,
interior: InteriorKind)
-> Rc<cmt_<'tcx>> where N: ast_node
rustc_private
)fn cat_downcast<N>(&self,
node: &N,
base_cmt: Rc<cmt_<'tcx>>,
downcast_ty: &'tcx TyS<'tcx>,
variant_did: DefId)
-> Rc<cmt_<'tcx>> where N: ast_node
node: &N,
base_cmt: Rc<cmt_<'tcx>>,
downcast_ty: &'tcx TyS<'tcx>,
variant_did: DefId)
-> Rc<cmt_<'tcx>> where N: ast_node
rustc_private
)fn cat_pattern<F>(&self,
cmt: Rc<cmt_<'tcx>>,
pat: &Pat,
op: F)
-> Result<(), ()> where F: FnMut(&MemCategorizationContext<'a, 'gcx, 'tcx>, Rc<cmt_<'tcx>>, &Pat) -> ()
cmt: Rc<cmt_<'tcx>>,
pat: &Pat,
op: F)
-> Result<(), ()> where F: FnMut(&MemCategorizationContext<'a, 'gcx, 'tcx>, Rc<cmt_<'tcx>>, &Pat) -> ()
rustc_private
)Trait Implementations
impl<'a, 'gcx, 'tcx> Clone for MemCategorizationContext<'a, 'gcx, 'tcx> where 'gcx: 'a,
'gcx: 'tcx,
'tcx: 'a
[src]
'gcx: 'tcx,
'tcx: 'a
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
impl<'a, 'gcx, 'tcx> Copy for MemCategorizationContext<'a, 'gcx, 'tcx> where 'gcx: 'a,
'gcx: 'tcx,
'tcx: 'a
[src]
'gcx: 'tcx,
'tcx: 'a