Don't create two new closures for each query
- Parameterize DepKindStruct over `'tcx` This allows passing in an invariant function pointer in `query_callback`, rather than having to try and make it work for any lifetime. - Add a new `execute_query` function to `QueryDescription` so we can call `tcx.$name` without needing to be in a macro context
This commit is contained in:
parent
4fcc745266
commit
4e09a13bb8
5 changed files with 31 additions and 37 deletions
|
@ -73,4 +73,7 @@ pub trait QueryDescription<CTX: QueryContext>: QueryConfig {
|
|||
fn make_vtable(tcx: CTX, key: &Self::Key) -> QueryVTable<CTX, Self::Key, Self::Value>;
|
||||
|
||||
fn cache_on_disk(tcx: CTX::DepContext, key: &Self::Key) -> bool;
|
||||
|
||||
// Don't use this method to compute query results, instead use the methods on TyCtxt
|
||||
fn execute_query(tcx: CTX::DepContext, k: Self::Key) -> Self::Stored;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue