Struct rustc::middle::mem_categorization::MemCategorizationContext [−][src]
pub struct MemCategorizationContext<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> { pub tcx: TyCtxt<'a, 'gcx, 'tcx>, pub region_scope_tree: &'a ScopeTree, pub tables: &'a TypeckTables<'tcx>, rvalue_promotable_map: Option<Lrc<ItemLocalSet>>, infcx: Option<&'a InferCtxt<'a, 'gcx, 'tcx>>, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields
tcx: TyCtxt<'a, 'gcx, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
region_scope_tree: &'a ScopeTree
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
tables: &'a TypeckTables<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
rvalue_promotable_map: Option<Lrc<ItemLocalSet>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
infcx: Option<&'a InferCtxt<'a, 'gcx, 'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Methods
impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx, 'tcx>
[src]
impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx, 'tcx>
pub fn new(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
region_scope_tree: &'a ScopeTree,
tables: &'a TypeckTables<'tcx>,
rvalue_promotable_map: Option<Lrc<ItemLocalSet>>
) -> MemCategorizationContext<'a, 'tcx, 'tcx>
[src]
pub fn new(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
region_scope_tree: &'a ScopeTree,
tables: &'a TypeckTables<'tcx>,
rvalue_promotable_map: Option<Lrc<ItemLocalSet>>
) -> MemCategorizationContext<'a, 'tcx, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx>
pub fn with_infer(
infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,
region_scope_tree: &'a ScopeTree,
tables: &'a TypeckTables<'tcx>
) -> MemCategorizationContext<'a, 'gcx, 'tcx>
[src]
pub fn with_infer(
infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,
region_scope_tree: &'a ScopeTree,
tables: &'a TypeckTables<'tcx>
) -> MemCategorizationContext<'a, 'gcx, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Creates a MemCategorizationContext
during type inference.
This is used during upvar analysis and a few other places.
Because the typeck tables are not yet complete, the results
from the analysis must be used with caution:
- rvalue promotions are not known, so the lifetimes of temporaries may be overly conservative;
- similarly, as the results of upvar analysis are not yet known, the results around upvar accesses may be incorrect.
pub fn type_moves_by_default(
&self,
param_env: ParamEnv<'tcx>,
ty: Ty<'tcx>,
span: Span
) -> bool
[src]
pub fn type_moves_by_default(
&self,
param_env: ParamEnv<'tcx>,
ty: Ty<'tcx>,
span: Span
) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn resolve_type_vars_if_possible<T>(&self, value: &T) -> T where
T: TypeFoldable<'tcx>,
[src]
fn resolve_type_vars_if_possible<T>(&self, value: &T) -> T where
T: TypeFoldable<'tcx>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn is_tainted_by_errors(&self) -> bool
[src]
fn is_tainted_by_errors(&self) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn resolve_type_vars_or_error(
&self,
id: HirId,
ty: Option<Ty<'tcx>>
) -> McResult<Ty<'tcx>>
[src]
fn resolve_type_vars_or_error(
&self,
id: HirId,
ty: Option<Ty<'tcx>>
) -> McResult<Ty<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn node_ty(&self, hir_id: HirId) -> McResult<Ty<'tcx>>
[src]
pub fn node_ty(&self, hir_id: HirId) -> McResult<Ty<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn expr_ty(&self, expr: &Expr) -> McResult<Ty<'tcx>>
[src]
pub fn expr_ty(&self, expr: &Expr) -> McResult<Ty<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn expr_ty_adjusted(&self, expr: &Expr) -> McResult<Ty<'tcx>>
[src]
pub fn expr_ty_adjusted(&self, expr: &Expr) -> McResult<Ty<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn pat_ty_adjusted(&self, pat: &Pat) -> McResult<Ty<'tcx>>
[src]
pub fn pat_ty_adjusted(&self, pat: &Pat) -> McResult<Ty<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Returns the type of value that this pattern matches against. Some non-obvious cases:
- a
ref x
binding matches against a value of typeT
and givesx
the type&T
; we returnT
. - a pattern with implicit derefs (thanks to default binding
modes #42640) may look like
Some(x)
but in fact have implicit deref patterns attached (e.g., it is really&Some(x)
). In that case, we return the "outermost" type (e.g., `&Option).
fn pat_ty_unadjusted(&self, pat: &Pat) -> McResult<Ty<'tcx>>
[src]
fn pat_ty_unadjusted(&self, pat: &Pat) -> McResult<Ty<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Like pat_ty
, but ignores implicit &
patterns.
pub fn cat_expr(&self, expr: &Expr) -> McResult<cmt_<'tcx>>
[src]
pub fn cat_expr(&self, expr: &Expr) -> McResult<cmt_<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn cat_expr_adjusted(
&self,
expr: &Expr,
previous: cmt_<'tcx>,
adjustment: &Adjustment<'tcx>
) -> McResult<cmt_<'tcx>>
[src]
pub fn cat_expr_adjusted(
&self,
expr: &Expr,
previous: cmt_<'tcx>,
adjustment: &Adjustment<'tcx>
) -> McResult<cmt_<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn cat_expr_adjusted_with<F>(
&self,
expr: &Expr,
previous: F,
adjustment: &Adjustment<'tcx>
) -> McResult<cmt_<'tcx>> where
F: FnOnce() -> McResult<cmt_<'tcx>>,
[src]
fn cat_expr_adjusted_with<F>(
&self,
expr: &Expr,
previous: F,
adjustment: &Adjustment<'tcx>
) -> McResult<cmt_<'tcx>> where
F: FnOnce() -> McResult<cmt_<'tcx>>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn cat_expr_unadjusted(&self, expr: &Expr) -> McResult<cmt_<'tcx>>
[src]
pub fn cat_expr_unadjusted(&self, expr: &Expr) -> McResult<cmt_<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn cat_def(
&self,
hir_id: HirId,
span: Span,
expr_ty: Ty<'tcx>,
def: Def
) -> McResult<cmt_<'tcx>>
[src]
pub fn cat_def(
&self,
hir_id: HirId,
span: Span,
expr_ty: Ty<'tcx>,
def: Def
) -> McResult<cmt_<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn cat_upvar(
&self,
hir_id: HirId,
span: Span,
var_id: NodeId,
fn_node_id: NodeId
) -> McResult<cmt_<'tcx>>
[src]
fn cat_upvar(
&self,
hir_id: HirId,
span: Span,
var_id: NodeId,
fn_node_id: NodeId
) -> McResult<cmt_<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn env_deref(
&self,
hir_id: HirId,
span: Span,
upvar_id: UpvarId,
upvar_mutbl: MutabilityCategory,
env_borrow_kind: BorrowKind,
cmt_result: cmt_<'tcx>
) -> cmt_<'tcx>
[src]
fn env_deref(
&self,
hir_id: HirId,
span: Span,
upvar_id: UpvarId,
upvar_mutbl: MutabilityCategory,
env_borrow_kind: BorrowKind,
cmt_result: cmt_<'tcx>
) -> cmt_<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn temporary_scope(&self, id: ItemLocalId) -> Region<'tcx>
[src]
pub fn temporary_scope(&self, id: ItemLocalId) -> Region<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Returns the lifetime of a temporary created by expr with id id
.
This could be 'static
if id
is part of a constant expression.
pub fn cat_rvalue_node(
&self,
hir_id: HirId,
span: Span,
expr_ty: Ty<'tcx>
) -> cmt_<'tcx>
[src]
pub fn cat_rvalue_node(
&self,
hir_id: HirId,
span: Span,
expr_ty: Ty<'tcx>
) -> cmt_<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn cat_rvalue(
&self,
cmt_hir_id: HirId,
span: Span,
temp_scope: Region<'tcx>,
expr_ty: Ty<'tcx>
) -> cmt_<'tcx>
[src]
pub fn cat_rvalue(
&self,
cmt_hir_id: HirId,
span: Span,
temp_scope: Region<'tcx>,
expr_ty: Ty<'tcx>
) -> cmt_<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn cat_field<N: HirNode>(
&self,
node: &N,
base_cmt: cmt<'tcx>,
f_index: usize,
f_ident: Ident,
f_ty: Ty<'tcx>
) -> cmt_<'tcx>
[src]
pub fn cat_field<N: HirNode>(
&self,
node: &N,
base_cmt: cmt<'tcx>,
f_index: usize,
f_ident: Ident,
f_ty: Ty<'tcx>
) -> cmt_<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn cat_overloaded_place(
&self,
expr: &Expr,
base: &Expr,
note: Note
) -> McResult<cmt_<'tcx>>
[src]
fn cat_overloaded_place(
&self,
expr: &Expr,
base: &Expr,
note: Note
) -> McResult<cmt_<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn cat_deref(
&self,
node: &impl HirNode,
base_cmt: cmt<'tcx>,
note: Note
) -> McResult<cmt_<'tcx>>
[src]
pub fn cat_deref(
&self,
node: &impl HirNode,
base_cmt: cmt<'tcx>,
note: Note
) -> McResult<cmt_<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn cat_index<N: HirNode>(
&self,
elt: &N,
base_cmt: cmt<'tcx>,
element_ty: Ty<'tcx>,
context: InteriorOffsetKind
) -> McResult<cmt_<'tcx>>
[src]
fn cat_index<N: HirNode>(
&self,
elt: &N,
base_cmt: cmt<'tcx>,
element_ty: Ty<'tcx>,
context: InteriorOffsetKind
) -> McResult<cmt_<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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 HIR node being indexedbase_cmt
: the cmt ofelt
pub fn cat_imm_interior<N: HirNode>(
&self,
node: &N,
base_cmt: cmt<'tcx>,
interior_ty: Ty<'tcx>,
interior: InteriorKind
) -> cmt_<'tcx>
[src]
pub fn cat_imm_interior<N: HirNode>(
&self,
node: &N,
base_cmt: cmt<'tcx>,
interior_ty: Ty<'tcx>,
interior: InteriorKind
) -> cmt_<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn cat_downcast_if_needed<N: HirNode>(
&self,
node: &N,
base_cmt: cmt<'tcx>,
variant_did: DefId
) -> cmt<'tcx>
[src]
pub fn cat_downcast_if_needed<N: HirNode>(
&self,
node: &N,
base_cmt: cmt<'tcx>,
variant_did: DefId
) -> cmt<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn cat_pattern<F>(&self, cmt: cmt<'tcx>, pat: &Pat, op: F) -> McResult<()> where
F: FnMut(cmt<'tcx>, &Pat),
[src]
pub fn cat_pattern<F>(&self, cmt: cmt<'tcx>, pat: &Pat, op: F) -> McResult<()> where
F: FnMut(cmt<'tcx>, &Pat),
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn cat_pattern_<F>(&self, cmt: cmt<'tcx>, pat: &Pat, op: &mut F) -> McResult<()> where
F: FnMut(cmt<'tcx>, &Pat),
[src]
fn cat_pattern_<F>(&self, cmt: cmt<'tcx>, pat: &Pat, op: &mut F) -> McResult<()> where
F: FnMut(cmt<'tcx>, &Pat),
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Trait Implementations
impl<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> Clone for MemCategorizationContext<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> Clone for MemCategorizationContext<'a, 'gcx, 'tcx>
fn clone(&self) -> 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[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<'a, 'gcx, 'tcx> !Send for MemCategorizationContext<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Send for MemCategorizationContext<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Sync for MemCategorizationContext<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Sync for MemCategorizationContext<'a, 'gcx, 'tcx>