Struct rustc::mir::Mir
[−]
[src]
pub struct Mir<'tcx> {
pub visibility_scopes: IndexVec<VisibilityScope, VisibilityScopeData>,
pub visibility_scope_info: ClearCrossCrate<IndexVec<VisibilityScope, VisibilityScopeInfo>>,
pub promoted: IndexVec<Promoted, Mir<'tcx>>,
pub yield_ty: Option<Ty<'tcx>>,
pub generator_drop: Option<Box<Mir<'tcx>>>,
pub generator_layout: Option<GeneratorLayout<'tcx>>,
pub local_decls: IndexVec<Local, LocalDecl<'tcx>>,
pub arg_count: usize,
pub upvar_decls: Vec<UpvarDecl>,
pub spread_arg: Option<Local>,
pub span: Span,
// some fields omitted
}🔬 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?
Lowered representation of a single function.
Fields
visibility_scopes: IndexVec<VisibilityScope, VisibilityScopeData>
🔬 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?
List of visibility (lexical) scopes; these are referenced by statements
and used (eventually) for debuginfo. Indexed by a VisibilityScope.
visibility_scope_info: ClearCrossCrate<IndexVec<VisibilityScope, VisibilityScopeInfo>>
🔬 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?
Crate-local information for each visibility scope, that can't (and needn't) be tracked across crates.
promoted: IndexVec<Promoted, Mir<'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?
Rvalues promoted from this function, such as borrows of constants. Each of them is the Mir of a constant with the fn's type parameters in scope, but a separate set of locals.
yield_ty: Option<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?
Yield type of the function, if it is a generator.
generator_drop: Option<Box<Mir<'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?
Generator drop glue
generator_layout: Option<GeneratorLayout<'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?
The layout of a generator. Produced by the state transformation.
local_decls: IndexVec<Local, LocalDecl<'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?
Declarations of locals.
The first local is the return value pointer, followed by arg_count
locals for the function arguments, followed by any user-declared
variables and temporaries.
arg_count: usize
🔬 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?
Number of arguments this function takes.
Starting at local 1, arg_count locals will be provided by the caller
and can be assumed to be initialized.
If this MIR was built for a constant, this will be 0.
upvar_decls: Vec<UpvarDecl>
🔬 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?
Names and capture modes of all the closure upvars, assuming the first argument is either the closure or a reference to it.
spread_arg: Option<Local>
🔬 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?
Mark an argument local (which must be a tuple) as getting passed as its individual components at the LLVM level.
This is used for the "rust-call" ABI.
span: Span
🔬 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?
A span representing this MIR, for error reporting
Methods
impl<'tcx> Mir<'tcx>[src]
pub fn new(
basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>,
visibility_scopes: IndexVec<VisibilityScope, VisibilityScopeData>,
visibility_scope_info: ClearCrossCrate<IndexVec<VisibilityScope, VisibilityScopeInfo>>,
promoted: IndexVec<Promoted, Mir<'tcx>>,
yield_ty: Option<Ty<'tcx>>,
local_decls: IndexVec<Local, LocalDecl<'tcx>>,
arg_count: usize,
upvar_decls: Vec<UpvarDecl>,
span: Span
) -> Self[src]
basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>,
visibility_scopes: IndexVec<VisibilityScope, VisibilityScopeData>,
visibility_scope_info: ClearCrossCrate<IndexVec<VisibilityScope, VisibilityScopeInfo>>,
promoted: IndexVec<Promoted, Mir<'tcx>>,
yield_ty: Option<Ty<'tcx>>,
local_decls: IndexVec<Local, LocalDecl<'tcx>>,
arg_count: usize,
upvar_decls: Vec<UpvarDecl>,
span: Span
) -> Self
🔬 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 basic_blocks(&self) -> &IndexVec<BasicBlock, BasicBlockData<'tcx>>[src]
🔬 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 basic_blocks_mut(
&mut self
) -> &mut IndexVec<BasicBlock, BasicBlockData<'tcx>>[src]
&mut self
) -> &mut IndexVec<BasicBlock, BasicBlockData<'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 basic_blocks_and_local_decls_mut(
&mut self
) -> (&mut IndexVec<BasicBlock, BasicBlockData<'tcx>>, &mut IndexVec<Local, LocalDecl<'tcx>>)[src]
&mut self
) -> (&mut IndexVec<BasicBlock, BasicBlockData<'tcx>>, &mut IndexVec<Local, LocalDecl<'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 predecessors(&self) -> Ref<IndexVec<BasicBlock, Vec<BasicBlock>>>[src]
🔬 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 predecessors_for(&self, bb: BasicBlock) -> Ref<Vec<BasicBlock>>[src]
🔬 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 dominators(&self) -> Dominators<BasicBlock>[src]
🔬 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 local_kind(&self, local: Local) -> LocalKind[src]
🔬 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 temps_iter<'a>(&'a self) -> impl Iterator<Item = Local> + 'a[src]
🔬 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 an iterator over all temporaries.
pub fn vars_iter<'a>(&'a self) -> impl Iterator<Item = Local> + 'a[src]
🔬 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 an iterator over all user-declared locals.
pub fn args_iter(&self) -> impl Iterator<Item = Local>[src]
🔬 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 an iterator over all function arguments.
pub fn vars_and_temps_iter(&self) -> impl Iterator<Item = Local>[src]
🔬 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 an iterator over all user-defined variables and compiler-generated temporaries (all locals that are neither arguments nor the return place).
pub fn make_statement_nop(&mut self, location: Location)[src]
🔬 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?
Changes a statement to a nop. This is both faster than deleting instructions and avoids
invalidating statement indices in Locations.
pub fn source_info(&self, location: Location) -> &SourceInfo[src]
🔬 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 source info associated with location.
pub fn return_ty(&self) -> Ty<'tcx>[src]
🔬 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?
Return the return type, it always return first element from local_decls array
Trait Implementations
impl<'tcx> HasLocalDecls<'tcx> for Mir<'tcx>[src]
fn local_decls(&self) -> &IndexVec<Local, LocalDecl<'tcx>>[src]
🔬 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<'tcx> Clone for Mir<'tcx>[src]
fn clone(&self) -> Mir<'tcx>[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<'tcx> Encodable for Mir<'tcx>[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>[src]
🔬 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<'tcx> Decodable for Mir<'tcx>[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Mir<'tcx>, __D::Error>[src]
🔬 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<'tcx> Debug for Mir<'tcx>[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl<'tcx> HashStable<StableHashingContext<'tcx>> for Mir<'tcx>[src]
fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &mut StableHashingContext<'tcx>,
__hasher: &mut StableHasher<W>
)[src]
&self,
__ctx: &mut StableHashingContext<'tcx>,
__hasher: &mut StableHasher<W>
)
🔬 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<'tcx> Index<BasicBlock> for Mir<'tcx>[src]
type Output = BasicBlockData<'tcx>
The returned type after indexing.
fn index(&self, index: BasicBlock) -> &BasicBlockData<'tcx>[src]
Performs the indexing (container[index]) operation.
impl<'tcx> IndexMut<BasicBlock> for Mir<'tcx>[src]
fn index_mut(&mut self, index: BasicBlock) -> &mut BasicBlockData<'tcx>[src]
Performs the mutable indexing (container[index]) operation.
impl<'tcx> ControlFlowGraph for Mir<'tcx>[src]
type Node = BasicBlock
🔬 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 num_nodes(&self) -> usize[src]
🔬 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 start_node(&self) -> Self::Node[src]
🔬 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 predecessors<'graph>(&'graph self, node: Self::Node) -> Self::Iter[src]
🔬 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 successors<'graph>(&'graph self, node: Self::Node) -> Self::Iter[src]
🔬 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, 'b> GraphPredecessors<'b> for Mir<'a>[src]
type Item = BasicBlock
🔬 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?
type Iter = IntoIter<BasicBlock>
🔬 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, 'b> GraphSuccessors<'b> for Mir<'a>[src]
type Item = BasicBlock
🔬 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?
type Iter = IntoIter<BasicBlock>
🔬 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<'tcx> TypeFoldable<'tcx> for Mir<'tcx>[src]
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(
&self,
folder: &mut F
) -> Self[src]
&self,
folder: &mut F
) -> Self
🔬 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 super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool[src]
🔬 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 fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(
&self,
folder: &mut F
) -> Self[src]
&self,
folder: &mut F
) -> Self
🔬 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 visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool[src]
🔬 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 has_regions_escaping_depth(&self, depth: u32) -> bool[src]
🔬 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 has_escaping_regions(&self) -> bool[src]
🔬 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 has_type_flags(&self, flags: TypeFlags) -> bool[src]
🔬 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 has_projections(&self) -> bool[src]
🔬 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 references_error(&self) -> bool[src]
🔬 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 has_param_types(&self) -> bool[src]
🔬 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 has_self_ty(&self) -> bool[src]
🔬 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 has_infer_types(&self) -> bool[src]
🔬 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 needs_infer(&self) -> bool[src]
🔬 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 needs_subst(&self) -> bool[src]
🔬 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 has_re_skol(&self) -> bool[src]
🔬 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 has_closure_types(&self) -> bool[src]
🔬 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 has_erasable_regions(&self) -> bool[src]
🔬 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_normalized_for_trans(&self) -> bool[src]
🔬 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_global(&self) -> bool[src]
🔬 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?
Indicates whether this value references only 'global' types/lifetimes that are the same regardless of what fn we are in. This is used for caching. Errs on the side of returning false. Read more