Struct rustc_infer::infer::undo_log::InferCtxtUndoLogs[−][src]

pub(crate) struct InferCtxtUndoLogs<'tcx> {
    logs: Vec<UndoLog<'tcx>>,
    num_open_snapshots: usize,
}
Expand description

The combined undo log for all the various unification tables. For each change to the storage for any kind of inference variable, we record an UndoLog entry in the vector here.

Fields

logs: Vec<UndoLog<'tcx>>num_open_snapshots: usize

Implementations

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

pub fn start_snapshot(&mut self) -> Snapshot<'tcx>[src]

pub(crate) fn region_constraints_in_snapshot(
    &self,
    s: &Snapshot<'tcx>
) -> impl Iterator<Item = &UndoLog<'tcx>> + Clone
[src]

pub(crate) fn region_constraints(
    &self
) -> impl Iterator<Item = &UndoLog<'tcx>> + Clone
[src]

fn assert_open_snapshot(&self, snapshot: &Snapshot<'tcx>)[src]

Trait Implementations

impl Default for InferCtxtUndoLogs<'_>[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl<'tcx> Index<usize> for InferCtxtUndoLogs<'tcx>[src]

type Output = UndoLog<'tcx>

The returned type after indexing.

fn index(&self, key: usize) -> &Self::Output[src]

Performs the indexing (container[index]) operation. Read more

impl<'tcx> IndexMut<usize> for InferCtxtUndoLogs<'tcx>[src]

fn index_mut(&mut self, key: usize) -> &mut Self::Output[src]

Performs the mutable indexing (container[index]) operation. Read more

impl<'tcx, T> UndoLogs<T> for InferCtxtUndoLogs<'tcx> where
    UndoLog<'tcx>: From<T>, 
[src]

The UndoLogs trait defines how we undo a particular kind of action (of type T). We can undo any action that is convertable into a UndoLog (per the From impls above).

fn num_open_snapshots(&self) -> usize[src]

How many open snapshots this undo log currently has

fn push(&mut self, undo: T)[src]

Pushes a new “undo item” onto the undo log. This method is invoked when some action is taken (e.g., a variable is unified). It records the info needed to reverse that action should an enclosing snapshot be rolleod back. Read more

fn clear(&mut self)[src]

Removes all items from the undo log.

fn extend<J>(&mut self, undos: J) where
    Self: Sized,
    J: IntoIterator<Item = T>, 
[src]

Extends the undo log with many undos.

fn in_snapshot(&self) -> bool

True if a snapshot has started, false otherwise

Auto Trait Implementations

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

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

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

impl<'tcx> Unpin for InferCtxtUndoLogs<'tcx>

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

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> WithConstness for T[src]

fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]

fn with_const(self) -> ConstnessAnd<Self>[src]

fn without_const(self) -> ConstnessAnd<Self>[src]

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