pub struct PlaceInfo<'tcx> {
place_to_index: FxHashMap<PlaceId, usize>,
index_to_place: Vec<PlaceId>,
place_to_mir: FxHashMap<PlaceId, Place<'tcx>>,
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
place_to_mir: FxHashMap<PlaceId, Place<'tcx>>Mapping from PlaceId to MIR Place (when available)
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<'tcx>
impl<'tcx> PlaceInfo<'tcx>
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
Sourcepub fn associate_mir_place(&mut self, place_id: PlaceId, mir_place: Place<'tcx>)
pub fn associate_mir_place(&mut self, place_id: PlaceId, mir_place: Place<'tcx>)
Associate a MIR place with a PlaceId
Trait Implementations§
Auto Trait Implementations§
impl<'tcx> Freeze for PlaceInfo<'tcx>
impl<'tcx> !RefUnwindSafe for PlaceInfo<'tcx>
impl<'tcx> Send for PlaceInfo<'tcx>
impl<'tcx> Sync for PlaceInfo<'tcx>
impl<'tcx> Unpin for PlaceInfo<'tcx>
impl<'tcx> !UnwindSafe for PlaceInfo<'tcx>
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