pub struct PlaceInfo {
place_to_index: FxHashMap<PlaceId, usize>,
index_to_place: Vec<PlaceId>,
may_drop: Vec<bool>,
need_drop: Vec<bool>,
num_places: usize,
}Expand description
Information about all places in a function
Fields§
§place_to_index: FxHashMap<PlaceId, usize>Mapping from PlaceId to index
index_to_place: Vec<PlaceId>Mapping from index to PlaceId
may_drop: Vec<bool>Whether each place may need drop
need_drop: Vec<bool>Whether each place needs drop
num_places: usizeTotal number of places
Implementations§
Source§impl<'tcx> PlaceInfo
impl<'tcx> PlaceInfo
Sourcepub fn build(tcx: TyCtxt<'tcx>, def_id: DefId, body: &'tcx Body<'tcx>) -> Self
pub fn build(tcx: TyCtxt<'tcx>, def_id: DefId, body: &'tcx Body<'tcx>) -> Self
Build PlaceInfo from MIR body
Sourcefn create_fields_for_type(
&mut self,
tcx: TyCtxt<'tcx>,
ty: Ty<'tcx>,
base_place: PlaceId,
field_depth: usize,
deref_depth: usize,
ty_env: TypingEnv<'tcx>,
)
fn create_fields_for_type( &mut self, tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, base_place: PlaceId, field_depth: usize, deref_depth: usize, ty_env: TypingEnv<'tcx>, )
Recursively create field PlaceIds for a type
Sourcepub fn register_place(
&mut self,
place_id: PlaceId,
may_drop: bool,
need_drop: bool,
) -> usize
pub fn register_place( &mut self, place_id: PlaceId, may_drop: bool, need_drop: bool, ) -> usize
Register a new place and return its index
Sourcepub fn num_places(&self) -> usize
pub fn num_places(&self) -> usize
Get total number of places
Trait Implementations§
Auto Trait Implementations§
impl DynSend for PlaceInfo
impl DynSync for PlaceInfo
impl Freeze for PlaceInfo
impl RefUnwindSafe for PlaceInfo
impl Send for PlaceInfo
impl Sync for PlaceInfo
impl Unpin for PlaceInfo
impl UnsafeUnpin for PlaceInfo
impl UnwindSafe for PlaceInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more