Struct rustc_middle::mir::BasicBlock[][src]

pub struct BasicBlock {
    private: u32,

A node in the MIR control-flow graph.

There are no branches (e.g., ifs, function calls, etc.) within a basic block, which makes it easier to do data-flow analyses and optimizations. Instead, branches are represented as an edge in a graph between basic blocks.

Basic blocks consist of a series of statements, ending with a terminator. Basic blocks can have multiple predecessors and successors, however there is a MIR pass (CriticalCallEdges) that removes critical edges, which are edges that go from a multi-successor node to a multi-predecessor node. This pass is needed because some analyses require that there are no critical edges in the CFG.

Note that this type is just an index into Body.basic_blocks; the actual data that a basic block holds is in BasicBlockData.

Read more about basic blocks in the rustc-dev-guide.


private: u32


impl BasicBlock[src]

pub const MAX_AS_U32: u32[src]

pub const MAX: Self[src]

pub const fn from_usize(value: usize) -> Self[src]

pub const fn from_u32(value: u32) -> Self[src]

pub const unsafe fn from_u32_unchecked(value: u32) -> Self[src]

pub const fn index(self) -> usize[src]

Extracts the value of this index as an integer.

pub const fn as_u32(self) -> u32[src]

Extracts the value of this index as a u32.

pub const fn as_usize(self) -> usize[src]

Extracts the value of this index as a usize.

impl BasicBlock[src]

pub fn start_location(self) -> Location[src]

Trait Implementations

impl Add<usize> for BasicBlock[src]

type Output = Self

The resulting type after applying the + operator.

impl Clone for BasicBlock[src]

impl Copy for BasicBlock[src]

impl Debug for BasicBlock[src]

impl<D: Decoder> Decodable<D> for BasicBlock[src]

impl<E: Encoder> Encodable<E> for BasicBlock[src]

impl Eq for BasicBlock[src]

impl From<u32> for BasicBlock[src]

impl From<usize> for BasicBlock[src]

impl Hash for BasicBlock[src]

impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for BasicBlock[src]

impl Idx for BasicBlock[src]

impl<'tcx> Index<BasicBlock> for Body<'tcx>[src]

type Output = BasicBlockData<'tcx>

The returned type after indexing.

impl<'tcx> IndexMut<BasicBlock> for Body<'tcx>[src]

impl Ord for BasicBlock[src]

impl PartialEq<BasicBlock> for BasicBlock[src]

impl PartialOrd<BasicBlock> for BasicBlock[src]

impl Step for BasicBlock[src]

impl StructuralEq for BasicBlock[src]

impl StructuralPartialEq for BasicBlock[src]

Auto Trait Implementations

impl RefUnwindSafe for BasicBlock

impl Send for BasicBlock

impl Sync for BasicBlock

impl Unpin for BasicBlock

impl UnwindSafe for BasicBlock

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
    T: Copy

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<'a, T> Captures<'a> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> MaybeResult<T> for T[src]

type Error = !

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]