1
Fork 0

resolve: Rename some cstore methods to match queries and add comments

about costs associated with replacing them with query calls.
This commit is contained in:
Vadim Petrochenkov 2023-03-23 20:15:04 +04:00
parent 99c49d95cd
commit 71927ad083
4 changed files with 12 additions and 14 deletions

View file

@ -1871,7 +1871,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
fn def_span(&self, def_id: DefId) -> Span {
match def_id.as_local() {
Some(def_id) => self.tcx.source_span(def_id),
None => self.cstore().get_span_untracked(def_id, self.tcx.sess),
// Query `def_span` is not used because hashing its result span is expensive.
None => self.cstore().def_span_untracked(def_id, self.tcx.sess),
}
}