Auto merge of #108118 - oli-obk:lazy_typeck, r=cjgillot
Run various queries from other queries instead of explicitly in phases These are just legacy leftovers from when rustc didn't have a query system. While there are more cleanups of this sort that can be done here, I want to land them in smaller steps. This phased order of query invocations was already a lie, as any query that looks at types (e.g. the wf checks run before) can invoke e.g. const eval which invokes borrowck, which invokes typeck, ...
This commit is contained in:
commit
3462f79e94
42 changed files with 400 additions and 423 deletions
|
@ -80,6 +80,8 @@ use std::iter;
|
|||
use std::mem;
|
||||
use std::ops::{Bound, Deref};
|
||||
|
||||
use super::query::IntoQueryParam;
|
||||
|
||||
const TINY_CONST_EVAL_LIMIT: Limit = Limit(20);
|
||||
|
||||
pub trait OnDiskCache<'tcx>: rustc_data_structures::sync::Sync {
|
||||
|
@ -824,7 +826,8 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
self.features_query(())
|
||||
}
|
||||
|
||||
pub fn def_key(self, id: DefId) -> rustc_hir::definitions::DefKey {
|
||||
pub fn def_key(self, id: impl IntoQueryParam<DefId>) -> rustc_hir::definitions::DefKey {
|
||||
let id = id.into_query_param();
|
||||
// Accessing the DefKey is ok, since it is part of DefPathHash.
|
||||
if let Some(id) = id.as_local() {
|
||||
self.definitions_untracked().def_key(id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue