Struct rupta::mir::known_names::KnownNamesCache
source · pub struct KnownNamesCache { /* private fields */ }Expand description
An analysis lifetime cache that contains a map from def ids to known names.
Implementations§
source§impl KnownNamesCache
impl KnownNamesCache
sourcepub fn create_cache_from_language_items() -> KnownNamesCache
pub fn create_cache_from_language_items() -> KnownNamesCache
Create an empty known names cache. This cache is re-used by every successive MIR visitor instance.
sourcepub fn get(&mut self, tcx: TyCtxt<'_>, def_id: DefId) -> KnownNames
pub fn get(&mut self, tcx: TyCtxt<'_>, def_id: DefId) -> KnownNames
Get the well known name for the given def id and cache the association. I.e. the first call for an unknown def id will be somewhat costly but subsequent calls will be cheap. If the def_id does not have an actual well known name, this returns KnownNames::None.
Auto Trait Implementations§
impl RefUnwindSafe for KnownNamesCache
impl Send for KnownNamesCache
impl Sync for KnownNamesCache
impl Unpin for KnownNamesCache
impl UnwindSafe for KnownNamesCache
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