Struct rustc_mir::dataflow::impls::DefinitelyInitializedPlaces[][src]

pub struct DefinitelyInitializedPlaces<'a, 'gcx: 'tcx, 'tcx: 'a> {
    tcx: TyCtxt<'a, 'gcx, 'tcx>,
    mir: &'a Mir<'tcx>,
    mdpe: &'a MoveDataParamEnv<'gcx, '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?

DefinitelyInitializedPlaces tracks all places that are definitely initialized upon reaching a particular point in the control flow for a function.

FIXME: Note that once flow-analysis is complete, this should be the set-complement of MaybeUninitializedPlaces; thus we can get rid of one or the other of these two. I'm inclined to get rid of MaybeUninitializedPlaces, simply because the sets will tend to be smaller in this analysis and thus easier for humans to process when debugging.

For example, in code like the following, we have corresponding dataflow information shown in the right-hand comments.

struct S;
fn foo(pred: bool) {                       // definite-init:
                                           // {          }
    let a = S; let b = S; let c; let d;    // {a, b      }

    if pred {
        drop(a);                           // {   b,     }
        b = S;                             // {   b,     }

    } else {
        drop(b);                           // {a,        }
        d = S;                             // {a,       d}

    }                                      // {          }

    c = S;                                 // {       c  }
}

To determine whether a place may be uninitialized at a particular control-flow point, one can take the set-complement of this data.

Similarly, at a given drop statement, the set-difference between this data and MaybeInitializedPlaces yields the set of places that would require a dynamic drop-flag at that statement.

Fields

🔬 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?

🔬 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?

🔬 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?

Methods

impl<'a, 'gcx, 'tcx: 'a> DefinitelyInitializedPlaces<'a, 'gcx, '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<'a, 'gcx, 'tcx> DefinitelyInitializedPlaces<'a, 'gcx, '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?

Trait Implementations

impl<'a, 'gcx, 'tcx: 'a> HasMoveData<'tcx> for DefinitelyInitializedPlaces<'a, 'gcx, '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<'a, 'gcx, 'tcx> BitDenotation for DefinitelyInitializedPlaces<'a, 'gcx, '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?

Specifies what index type is used to access the bitvector.

🔬 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 name describing the dataflow analysis that this BitDenotation is supporting. The name should be something suitable for plugging in as part of a filename e.g. avoid space-characters or other things that tend to look bad on a file system, like slashes or periods. It is also better for the name to be reasonably short, again because it will be plugged into a filename. Read more

🔬 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?

Size of each bitvector allocated for each block in the analysis.

🔬 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?

Mutates the entry set according to the effects that have been established prior to entering the start block. This can't access the gen/kill sets, because these won't be accounted for correctly. Read more

🔬 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?

Mutates the block-sets (the flow sets for the given basic block) according to the effects of evaluating statement. Read more

🔬 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?

Mutates the block-sets (the flow sets for the given basic block) according to the effects of evaluating the terminator. Read more

🔬 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?

Mutates the block-sets according to the (flow-dependent) effect of a successful return from a Call terminator. Read more

🔬 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?

Some analyses want to accumulate knowledge within a block when analyzing its statements for building the gen/kill sets. Override this method to return true in such cases. Read more

🔬 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?

Similar to statement_effect, except it applies just before the statement rather than just after it. Read more

🔬 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?

Similar to terminator_effect, except it applies just before the terminator rather than just after it. Read more

impl<'a, 'gcx, 'tcx> BitwiseOperator for DefinitelyInitializedPlaces<'a, 'gcx, '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?

Applies some bit-operation pointwise to each of the bits in the two inputs.

impl<'a, 'gcx, 'tcx> InitialFlow for DefinitelyInitializedPlaces<'a, 'gcx, '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?

Specifies the initial value for each bit in the on_entry set

Auto Trait Implementations

impl<'a, 'gcx, 'tcx> !Send for DefinitelyInitializedPlaces<'a, 'gcx, 'tcx>

impl<'a, 'gcx, 'tcx> !Sync for DefinitelyInitializedPlaces<'a, 'gcx, 'tcx>