Struct rupta::util::type_util::PathCastCache
source · pub struct PathCastCache<'tcx> { /* private fields */ }Expand description
Manage the type cast for paths
Implementations§
source§impl<'tcx> PathCastCache<'tcx>
impl<'tcx> PathCastCache<'tcx>
pub fn new() -> PathCastCache<'tcx>
sourcepub fn get_cast_types(&self, path: &Rc<Path>) -> Option<&HashSet<Ty<'tcx>>>
pub fn get_cast_types(&self, path: &Rc<Path>) -> Option<&HashSet<Ty<'tcx>>>
Returns the types that a path may be cast to
sourcepub fn cast_to(
&mut self,
acx: &mut AnalysisContext<'tcx, '_>,
path: &Rc<Path>,
ty: Ty<'tcx>
) -> Option<Rc<Path>>
pub fn cast_to( &mut self, acx: &mut AnalysisContext<'tcx, '_>, path: &Rc<Path>, ty: Ty<'tcx> ) -> Option<Rc<Path>>
Creates a path that casts the given path to a given type
pub fn get_type_variant( &mut self, acx: &mut AnalysisContext<'tcx, '_>, path: &Rc<Path>, ty: Ty<'tcx> ) -> Option<Rc<Path>>
sourcepub fn get_regularized_path(
acx: &mut AnalysisContext<'tcx, '_>,
path: Rc<Path>
) -> Rc<Path>
pub fn get_regularized_path( acx: &mut AnalysisContext<'tcx, '_>, path: Rc<Path> ) -> Rc<Path>
Different paths may refer to the same memory location, we can regularize these path to a base path e.g. a.0.0, a.0, a.cast#T’ and a are all represented by one path
Trait Implementations§
Auto Trait Implementations§
impl<'tcx> !RefUnwindSafe for PathCastCache<'tcx>
impl<'tcx> !Send for PathCastCache<'tcx>
impl<'tcx> !Sync for PathCastCache<'tcx>
impl<'tcx> Unpin for PathCastCache<'tcx>
impl<'tcx> !UnwindSafe for PathCastCache<'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