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.
(&mut self, tcx: TyCtxt<'_>, def_id: DefId)
| 108 | /// subsequent calls will be cheap. If the def_id does not have an actual well |
| 109 | /// known name, this returns KnownNames::None. |
| 110 | pub fn get(&mut self, tcx: TyCtxt<'_>, def_id: DefId) -> KnownNames { |
| 111 | *self |
| 112 | .name_cache |
| 113 | .entry(def_id) |
| 114 | .or_insert_with(|| Self::get_known_name_for(tcx, def_id)) |
| 115 | } |
| 116 | |
| 117 | /// Uses information obtained from tcx to figure out which well known name (if any) |
| 118 | /// this def id corresponds to. |
no outgoing calls
no test coverage detected