Struct rustc_mir::util::elaborate_drops::DropCtxt [−][src]
struct DropCtxt<'l, 'b: 'l, 'tcx: 'b, D> where
D: DropElaborator<'b, 'tcx> + 'l, { elaborator: &'l mut D, source_info: SourceInfo, place: &'l Place<'tcx>, path: D::Path, succ: BasicBlock, unwind: Unwind, }
🔬 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?
Fields
elaborator: &'l mut D
🔬 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?
source_info: SourceInfo
🔬 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?
place: &'l Place<'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?
path: D::Path
🔬 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?
succ: BasicBlock
🔬 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?
unwind: Unwind
🔬 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<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> where
D: DropElaborator<'b, 'tcx>,
[src]
impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> where
D: DropElaborator<'b, 'tcx>,
fn place_ty(&self, place: &Place<'tcx>) -> Ty<'tcx>
[src]
fn place_ty(&self, place: &Place<'tcx>) -> Ty<'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?
fn tcx(&self) -> TyCtxt<'b, 'tcx, 'tcx>
[src]
fn tcx(&self) -> TyCtxt<'b, 'tcx, '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?
pub fn elaborate_drop<'a>(&mut self, bb: BasicBlock)
[src]
pub fn elaborate_drop<'a>(&mut self, bb: BasicBlock)
🔬 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 elaborates a single drop instruction, located at bb
, and
patches over it.
The elaborated drop checks the drop flags to only drop what is initialized.
In addition, the relevant drop flags also need to be cleared to avoid double-drops. However, in the middle of a complex drop, one must avoid clearing some of the flags before they are read, as that would cause a memory leak.
In particular, when dropping an ADT, multiple fields may be
joined together under the rest
subpath. They are all controlled
by the primary drop flag, but only the last rest-field dropped
should clear it (and it must also not clear anything else).
FIXME: I think we should just control the flags externally and then we do not need this machinery.
fn move_paths_for_fields(
&self,
base_place: &Place<'tcx>,
variant_path: D::Path,
variant: &'tcx VariantDef,
substs: &'tcx Substs<'tcx>
) -> Vec<(Place<'tcx>, Option<D::Path>)>
[src]
fn move_paths_for_fields(
&self,
base_place: &Place<'tcx>,
variant_path: D::Path,
variant: &'tcx VariantDef,
substs: &'tcx Substs<'tcx>
) -> Vec<(Place<'tcx>, Option<D::Path>)>
🔬 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?
Return the place and move path for each field of variant
,
(the move path is None
if the field is a rest field).
fn drop_subpath(
&mut self,
place: &Place<'tcx>,
path: Option<D::Path>,
succ: BasicBlock,
unwind: Unwind
) -> BasicBlock
[src]
fn drop_subpath(
&mut self,
place: &Place<'tcx>,
path: Option<D::Path>,
succ: BasicBlock,
unwind: Unwind
) -> BasicBlock
🔬 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?
fn drop_halfladder(
&mut self,
unwind_ladder: &[Unwind],
succ: BasicBlock,
fields: &[(Place<'tcx>, Option<D::Path>)]
) -> Vec<BasicBlock>
[src]
fn drop_halfladder(
&mut self,
unwind_ladder: &[Unwind],
succ: BasicBlock,
fields: &[(Place<'tcx>, Option<D::Path>)]
) -> Vec<BasicBlock>
🔬 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?
Create one-half of the drop ladder for a list of fields, and return the list of steps in it in reverse order, with the first step dropping 0 fields and so on.
unwind_ladder
is such a list of steps in reverse order,
which is called if the matching step of the drop glue panics.
fn drop_ladder_bottom(&mut self) -> (BasicBlock, Unwind)
[src]
fn drop_ladder_bottom(&mut self) -> (BasicBlock, Unwind)
🔬 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?
fn drop_ladder<'a>(
&mut self,
fields: Vec<(Place<'tcx>, Option<D::Path>)>,
succ: BasicBlock,
unwind: Unwind
) -> (BasicBlock, Unwind)
[src]
fn drop_ladder<'a>(
&mut self,
fields: Vec<(Place<'tcx>, Option<D::Path>)>,
succ: BasicBlock,
unwind: Unwind
) -> (BasicBlock, Unwind)
🔬 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?
Create a full drop ladder, consisting of 2 connected half-drop-ladders
For example, with 3 fields, the drop ladder is
.d0:
ELAB(drop location.0 [target=.d1, unwind=.c1])
.d1:
ELAB(drop location.1 [target=.d2, unwind=.c2])
.d2:
ELAB(drop location.2 [target=self.succ
, unwind=self.unwind
])
.c1:
ELAB(drop location.1 [target=.c2])
.c2:
ELAB(drop location.2 [target=self.unwind
])
NOTE: this does not clear the master drop flag, so you need
to point succ/unwind on a drop_ladder_bottom
.
fn open_drop_for_tuple<'a>(&mut self, tys: &[Ty<'tcx>]) -> BasicBlock
[src]
fn open_drop_for_tuple<'a>(&mut self, tys: &[Ty<'tcx>]) -> BasicBlock
🔬 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?
fn open_drop_for_box<'a>(
&mut self,
adt: &'tcx AdtDef,
substs: &'tcx Substs<'tcx>
) -> BasicBlock
[src]
fn open_drop_for_box<'a>(
&mut self,
adt: &'tcx AdtDef,
substs: &'tcx Substs<'tcx>
) -> BasicBlock
🔬 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?
fn open_drop_for_adt<'a>(
&mut self,
adt: &'tcx AdtDef,
substs: &'tcx Substs<'tcx>
) -> BasicBlock
[src]
fn open_drop_for_adt<'a>(
&mut self,
adt: &'tcx AdtDef,
substs: &'tcx Substs<'tcx>
) -> BasicBlock
🔬 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?
fn open_drop_for_adt_contents(
&mut self,
adt: &'tcx AdtDef,
substs: &'tcx Substs<'tcx>
) -> (BasicBlock, Unwind)
[src]
fn open_drop_for_adt_contents(
&mut self,
adt: &'tcx AdtDef,
substs: &'tcx Substs<'tcx>
) -> (BasicBlock, Unwind)
🔬 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?
fn open_drop_for_multivariant(
&mut self,
adt: &'tcx AdtDef,
substs: &'tcx Substs<'tcx>,
succ: BasicBlock,
unwind: Unwind
) -> (BasicBlock, Unwind)
[src]
fn open_drop_for_multivariant(
&mut self,
adt: &'tcx AdtDef,
substs: &'tcx Substs<'tcx>,
succ: BasicBlock,
unwind: Unwind
) -> (BasicBlock, Unwind)
🔬 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?
fn adt_switch_block(
&mut self,
adt: &'tcx AdtDef,
blocks: Vec<BasicBlock>,
values: &[u128],
succ: BasicBlock,
unwind: Unwind
) -> BasicBlock
[src]
fn adt_switch_block(
&mut self,
adt: &'tcx AdtDef,
blocks: Vec<BasicBlock>,
values: &[u128],
succ: BasicBlock,
unwind: Unwind
) -> BasicBlock
🔬 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?
fn destructor_call_block<'a>(
&mut self,
(succ, unwind): (BasicBlock, Unwind)
) -> BasicBlock
[src]
fn destructor_call_block<'a>(
&mut self,
(succ, unwind): (BasicBlock, Unwind)
) -> BasicBlock
🔬 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?
fn drop_loop(
&mut self,
succ: BasicBlock,
cur: Local,
length_or_end: &Place<'tcx>,
ety: Ty<'tcx>,
unwind: Unwind,
ptr_based: bool
) -> BasicBlock
[src]
fn drop_loop(
&mut self,
succ: BasicBlock,
cur: Local,
length_or_end: &Place<'tcx>,
ety: Ty<'tcx>,
unwind: Unwind,
ptr_based: bool
) -> BasicBlock
🔬 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?
create a loop that drops an array:
loop-block: can_go = cur == length_or_end if can_go then succ else drop-block drop-block: if ptr_based { ptr = cur cur = cur.offset(1) } else { ptr = &mut P[cur] cur = cur + 1 } drop(ptr)
fn open_drop_for_array(
&mut self,
ety: Ty<'tcx>,
opt_size: Option<u64>
) -> BasicBlock
[src]
fn open_drop_for_array(
&mut self,
ety: Ty<'tcx>,
opt_size: Option<u64>
) -> BasicBlock
🔬 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?
fn drop_loop_pair(&mut self, ety: Ty<'tcx>, ptr_based: bool) -> BasicBlock
[src]
fn drop_loop_pair(&mut self, ety: Ty<'tcx>, ptr_based: bool) -> BasicBlock
🔬 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?
fn open_drop<'a>(&mut self) -> BasicBlock
[src]
fn open_drop<'a>(&mut self) -> BasicBlock
🔬 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?
The slow-path - create an "open", elaborated drop for a type
which is moved-out-of only partially, and patch bb
to a jump
to it. This must not be called on ADTs with a destructor,
as these can't be moved-out-of, except for Box<T>
, which is
special-cased.
This creates a "drop ladder" that drops the needed fields of the ADT, both in the success case or if one of the destructors fail.
fn complete_drop<'a>(
&mut self,
drop_mode: Option<DropFlagMode>,
succ: BasicBlock,
unwind: Unwind
) -> BasicBlock
[src]
fn complete_drop<'a>(
&mut self,
drop_mode: Option<DropFlagMode>,
succ: BasicBlock,
unwind: Unwind
) -> BasicBlock
🔬 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?
Return a basic block that drop a place using the context
and path in c
. If mode
is something, also clear c
according to it.
if FLAG(self.path) if let Some(mode) = mode: FLAG(self.path)[mode] = false drop(self.place)
fn drop_flag_reset_block(
&mut self,
mode: DropFlagMode,
succ: BasicBlock,
unwind: Unwind
) -> BasicBlock
[src]
fn drop_flag_reset_block(
&mut self,
mode: DropFlagMode,
succ: BasicBlock,
unwind: Unwind
) -> BasicBlock
🔬 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?
fn elaborated_drop_block<'a>(&mut self) -> BasicBlock
[src]
fn elaborated_drop_block<'a>(&mut self) -> BasicBlock
🔬 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?
fn box_free_block<'a>(
&mut self,
adt: &'tcx AdtDef,
substs: &'tcx Substs<'tcx>,
target: BasicBlock,
unwind: Unwind
) -> BasicBlock
[src]
fn box_free_block<'a>(
&mut self,
adt: &'tcx AdtDef,
substs: &'tcx Substs<'tcx>,
target: BasicBlock,
unwind: Unwind
) -> BasicBlock
🔬 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?
fn unelaborated_free_block<'a>(
&mut self,
adt: &'tcx AdtDef,
substs: &'tcx Substs<'tcx>,
target: BasicBlock,
unwind: Unwind
) -> BasicBlock
[src]
fn unelaborated_free_block<'a>(
&mut self,
adt: &'tcx AdtDef,
substs: &'tcx Substs<'tcx>,
target: BasicBlock,
unwind: Unwind
) -> BasicBlock
🔬 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?
fn drop_block<'a>(&mut self, target: BasicBlock, unwind: Unwind) -> BasicBlock
[src]
fn drop_block<'a>(&mut self, target: BasicBlock, unwind: Unwind) -> BasicBlock
🔬 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?
fn drop_flag_test_block(
&mut self,
on_set: BasicBlock,
on_unset: BasicBlock,
unwind: Unwind
) -> BasicBlock
[src]
fn drop_flag_test_block(
&mut self,
on_set: BasicBlock,
on_unset: BasicBlock,
unwind: Unwind
) -> BasicBlock
🔬 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?
fn new_block<'a>(
&mut self,
unwind: Unwind,
k: TerminatorKind<'tcx>
) -> BasicBlock
[src]
fn new_block<'a>(
&mut self,
unwind: Unwind,
k: TerminatorKind<'tcx>
) -> BasicBlock
🔬 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?
fn new_temp(&mut self, ty: Ty<'tcx>) -> Local
[src]
fn new_temp(&mut self, ty: Ty<'tcx>) -> Local
🔬 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?
fn terminator_loc(&mut self, bb: BasicBlock) -> Location
[src]
fn terminator_loc(&mut self, bb: BasicBlock) -> 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?
fn constant_usize(&self, val: u16) -> Operand<'tcx>
[src]
fn constant_usize(&self, val: u16) -> Operand<'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?
fn assign(&self, lhs: &Place<'tcx>, rhs: Rvalue<'tcx>) -> Statement<'tcx>
[src]
fn assign(&self, lhs: &Place<'tcx>, rhs: Rvalue<'tcx>) -> Statement<'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?
Trait Implementations
impl<'l, 'b: 'l, 'tcx: 'b, D: Debug> Debug for DropCtxt<'l, 'b, 'tcx, D> where
D: DropElaborator<'b, 'tcx> + 'l,
D::Path: Debug,
[src]
impl<'l, 'b: 'l, 'tcx: 'b, D: Debug> Debug for DropCtxt<'l, 'b, 'tcx, D> where
D: DropElaborator<'b, 'tcx> + 'l,
D::Path: Debug,