Struct rustc_mir::transform::simplify::UsedLocals[−][src]

struct UsedLocals<'tcx> {
    increment: bool,
    use_count: IndexVec<Local, u32>,
    is_static: bool,
    local_decls: IndexVec<Local, LocalDecl<'tcx>>,
    param_env: ParamEnv<'tcx>,
    tcx: TyCtxt<'tcx>,
}

Keeps track of used & unused locals.

Fields

increment: booluse_count: IndexVec<Local, u32>is_static: boollocal_decls: IndexVec<Local, LocalDecl<'tcx>>param_env: ParamEnv<'tcx>tcx: TyCtxt<'tcx>

Implementations

impl<'tcx> UsedLocals<'tcx>[src]

fn new(body: &Body<'tcx>, tcx: TyCtxt<'tcx>) -> Self[src]

Determines which locals are used & unused in the given body.

fn is_used(&self, local: Local) -> bool[src]

Checks if local is used.

fn statement_removed(&mut self, statement: &Statement<'tcx>)[src]

Updates the use counts to reflect the removal of given statement.

fn visit_lhs(&mut self, place: &Place<'tcx>, location: Location)[src]

Visits a left-hand side of an assignment.

Trait Implementations

impl<'tcx> Visitor<'tcx> for UsedLocals<'tcx>[src]

Auto Trait Implementations

impl<'tcx> !RefUnwindSafe for UsedLocals<'tcx>

impl<'tcx> !Send for UsedLocals<'tcx>

impl<'tcx> !Sync for UsedLocals<'tcx>

impl<'tcx> Unpin for UsedLocals<'tcx>

impl<'tcx> !UnwindSafe for UsedLocals<'tcx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]