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
tcx: TyCtxt<'a, '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?
mir: &'a Mir<'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?
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?
Methods
impl<'a, 'gcx, 'tcx: 'a> DefinitelyInitializedPlaces<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx: 'a> DefinitelyInitializedPlaces<'a, 'gcx, 'tcx>
pub fn new(
tcx: TyCtxt<'a, 'gcx, 'tcx>,
mir: &'a Mir<'tcx>,
mdpe: &'a MoveDataParamEnv<'gcx, 'tcx>
) -> Self
[src]
pub fn new(
tcx: TyCtxt<'a, 'gcx, 'tcx>,
mir: &'a Mir<'tcx>,
mdpe: &'a MoveDataParamEnv<'gcx, 'tcx>
) -> Self
🔬 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]
impl<'a, 'gcx, 'tcx> DefinitelyInitializedPlaces<'a, 'gcx, 'tcx>
fn update_bits(
sets: &mut BlockSets<MovePathIndex>,
path: MovePathIndex,
state: DropFlagState
)
[src]
fn update_bits(
sets: &mut BlockSets<MovePathIndex>,
path: MovePathIndex,
state: DropFlagState
)
🔬 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]
impl<'a, 'gcx, 'tcx: 'a> HasMoveData<'tcx> for DefinitelyInitializedPlaces<'a, 'gcx, 'tcx>
fn move_data(&self) -> &MoveData<'tcx>
[src]
fn move_data(&self) -> &MoveData<'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?
impl<'a, 'gcx, 'tcx> BitDenotation for DefinitelyInitializedPlaces<'a, 'gcx, 'tcx>
[src]
impl<'a, 'gcx, 'tcx> BitDenotation for DefinitelyInitializedPlaces<'a, 'gcx, 'tcx>
type Idx = MovePathIndex
🔬 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.
fn name() -> &'static str
[src]
fn name() -> &'static str
🔬 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
fn bits_per_block(&self) -> usize
[src]
fn bits_per_block(&self) -> usize
🔬 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.
fn start_block_effect(&self, entry_set: &mut IdxSet<MovePathIndex>)
[src]
fn start_block_effect(&self, entry_set: &mut IdxSet<MovePathIndex>)
🔬 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
fn statement_effect(
&self,
sets: &mut BlockSets<MovePathIndex>,
location: Location
)
[src]
fn statement_effect(
&self,
sets: &mut BlockSets<MovePathIndex>,
location: Location
)
🔬 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
fn terminator_effect(
&self,
sets: &mut BlockSets<MovePathIndex>,
location: Location
)
[src]
fn terminator_effect(
&self,
sets: &mut BlockSets<MovePathIndex>,
location: Location
)
🔬 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
fn propagate_call_return(
&self,
in_out: &mut IdxSet<MovePathIndex>,
_call_bb: BasicBlock,
_dest_bb: BasicBlock,
dest_place: &Place
)
[src]
fn propagate_call_return(
&self,
in_out: &mut IdxSet<MovePathIndex>,
_call_bb: BasicBlock,
_dest_bb: BasicBlock,
dest_place: &Place
)
🔬 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
fn accumulates_intrablock_state() -> bool
[src]
fn accumulates_intrablock_state() -> bool
🔬 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
fn before_statement_effect(
&self,
_sets: &mut BlockSets<Self::Idx>,
_location: Location
)
[src]
fn before_statement_effect(
&self,
_sets: &mut BlockSets<Self::Idx>,
_location: Location
)
🔬 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
fn before_terminator_effect(
&self,
_sets: &mut BlockSets<Self::Idx>,
_location: Location
)
[src]
fn before_terminator_effect(
&self,
_sets: &mut BlockSets<Self::Idx>,
_location: Location
)
🔬 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]
impl<'a, 'gcx, 'tcx> BitwiseOperator for DefinitelyInitializedPlaces<'a, 'gcx, 'tcx>
fn join(&self, pred1: usize, pred2: usize) -> usize
[src]
fn join(&self, pred1: usize, pred2: usize) -> usize
🔬 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]
impl<'a, 'gcx, 'tcx> InitialFlow for DefinitelyInitializedPlaces<'a, 'gcx, 'tcx>
fn bottom_value() -> bool
[src]
fn bottom_value() -> bool
🔬 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> !Send for DefinitelyInitializedPlaces<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Sync for DefinitelyInitializedPlaces<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> !Sync for DefinitelyInitializedPlaces<'a, 'gcx, 'tcx>