pub struct PlaceTranslator<'a, 'tcx> {
async_info: &'a AsyncInfo,
parent_body_def_id: DefId,
parent_body: &'a Body<'tcx>,
tcx: TyCtxt<'tcx>,
destination: Place<'tcx>,
calling_convention: &'a CallingConvention<'tcx>,
precise: bool,
}
Expand description
This struct represents all the information necessary to translate places from a child (the callee) to its parent (caller) at the boundary of a particular function call.
Fields§
§async_info: &'a AsyncInfo
§parent_body_def_id: DefId
§parent_body: &'a Body<'tcx>
§tcx: TyCtxt<'tcx>
§destination: Place<'tcx>
§calling_convention: &'a CallingConvention<'tcx>
§precise: bool
Governs whether the translation produces precise results (1-1 child-parent translations) or approximate one’s (discarding child projections).
Implementations§
Source§impl<'a, 'tcx> PlaceTranslator<'a, 'tcx>
impl<'a, 'tcx> PlaceTranslator<'a, 'tcx>
Sourcepub(crate) fn new(
async_info: &'a AsyncInfo,
parent_body_def_id: DefId,
parent_body: &'a Body<'tcx>,
tcx: TyCtxt<'tcx>,
destination: Place<'tcx>,
calling_convention: &'a CallingConvention<'tcx>,
precise: bool,
) -> Self
pub(crate) fn new( async_info: &'a AsyncInfo, parent_body_def_id: DefId, parent_body: &'a Body<'tcx>, tcx: TyCtxt<'tcx>, destination: Place<'tcx>, calling_convention: &'a CallingConvention<'tcx>, precise: bool, ) -> Self
destination
must be the place to which the return is assigned in the
parent (caller).
The precise
parameter governs whether the translation produces precise
results (1-1 child-parent translations) or approximate one’s (discarding
child projections).
Sourcepub(crate) fn translate_to_parent(
&self,
child: Place<'tcx>,
) -> Option<Place<'tcx>>
pub(crate) fn translate_to_parent( &self, child: Place<'tcx>, ) -> Option<Place<'tcx>>
Returns a fully translated parent place. If self.precise == true
this
place will be a precise 1-1 translation, otherwise just the base parent
place.
Returns None
if the input child cannot be represented in the parent.
Sourcepub(crate) fn handle_translate<'b>(
&'b self,
child: Place<'tcx>,
) -> Option<PlaceTranslation<'b, 'tcx>>
pub(crate) fn handle_translate<'b>( &'b self, child: Place<'tcx>, ) -> Option<PlaceTranslation<'b, 'tcx>>
Returns a calculated translation that needs to be finished.
Returns None
if the input child cannot be represented in the parent.
Auto Trait Implementations§
impl<'a, 'tcx> Freeze for PlaceTranslator<'a, 'tcx>
impl<'a, 'tcx> !RefUnwindSafe for PlaceTranslator<'a, 'tcx>
impl<'a, 'tcx> !Send for PlaceTranslator<'a, 'tcx>
impl<'a, 'tcx> !Sync for PlaceTranslator<'a, 'tcx>
impl<'a, 'tcx> Unpin for PlaceTranslator<'a, 'tcx>
impl<'a, 'tcx> !UnwindSafe for PlaceTranslator<'a, '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
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>
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>
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