struct EnsureGeneratorFieldAssignmentsNeverAlias<'a> {
    saved_locals: &'a GeneratorSavedLocals,
    storage_conflicts: &'a BitMatrix<GeneratorSavedLocal, GeneratorSavedLocal>,
    assigned_local: Option<GeneratorSavedLocal>,
}
Expand description

Looks for any assignments between locals (e.g., _4 = _5) that will both be converted to fields in the generator state machine but whose storage is not marked as conflicting

Validation needs to happen immediately before TransformVisitor is invoked, not after.

This condition would arise when the assignment is the last use of _5 but the initial definition of _4 if we weren’t extra careful to mark all locals used inside a statement as conflicting. Non-conflicting generator saved locals may be stored at the same location within the generator state machine, which would result in ill-formed MIR: the left-hand and right-hand sides of an assignment may not alias. This caused a miscompilation in #73137.

Fields

saved_locals: &'a GeneratorSavedLocalsstorage_conflicts: &'a BitMatrix<GeneratorSavedLocal, GeneratorSavedLocal>assigned_local: Option<GeneratorSavedLocal>

Implementations

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Layout

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 24 bytes