[−][src]Struct rustc::middle::mem_categorization::MemCategorizationContext
🔬 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>
Blanket Implementations
impl<T> MaybeResult for T
[src]
impl<T> MaybeResult for T
fn from_ok(T) -> T
[src]
fn from_ok(T) -> T
🔬 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 map_same<F>(Self, F) -> T where
F: FnOnce(T) -> T,
[src]
fn map_same<F>(Self, F) -> T where
F: FnOnce(T) -> T,
🔬 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, T> Captures for T where
T: ?Sized,
[src]
impl<'a, T> Captures for T where
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T
[src]
fn borrow(&self) -> &T
Immutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<E> SpecializationError for E
[src]
impl<E> SpecializationError for E
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
[src]
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
🔬 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?
Create an error for a missing method specialization. Defaults to panicking with type, trait & method names. S
is the encoder/decoder state type, T
is the type being encoded/decoded, and the arguments are the names of the trait and method that should've been overridden. Read more
impl<T> Erased for T
[src]
impl<T> Erased for T
impl<T> Send for T where
T: ?Sized,
[src]
impl<T> Send for T where
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
impl<T> Sync for T where
T: ?Sized,
impl<T> Erased for T
impl<T> Erased for T