diff options
| author | Joshua Nelson <jnelson@cloudflare.com> | 2022-09-05 06:43:11 -0500 |
|---|---|---|
| committer | Joshua Nelson <jnelson@cloudflare.com> | 2022-09-09 20:21:59 -0500 |
| commit | 9273782d559a342beb2443018f2f8fc873f53b79 (patch) | |
| tree | 1d32bc06daadfe64c198eb165f0f743e45d90be8 /compiler/rustc_query_impl/src | |
| parent | 7208bdee33460b9915e6b389b236d231d2ca3ffc (diff) | |
| download | rust-9273782d559a342beb2443018f2f8fc873f53b79.tar.gz rust-9273782d559a342beb2443018f2f8fc873f53b79.zip | |
Move `TRY_LOAD_FROM_DISK` out of `rustc_queries` to `rustc_query_impl`
We want to refer to `crate::plumbing::try_load_from_disk` in the const, but hard-coding it in rustc_queries, where we don't yet know the crate this macro will be called in, seems kind of hacky. Do it in query_impl instead.
Diffstat (limited to 'compiler/rustc_query_impl/src')
| -rw-r--r-- | compiler/rustc_query_impl/src/plumbing.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index 4ff3917e113..e38de2a0e40 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -412,6 +412,9 @@ macro_rules! define_queries { impl<'tcx> QueryDescription<QueryCtxt<'tcx>> for queries::$name<'tcx> { rustc_query_description! { $name } + const TRY_LOAD_FROM_DISK: Option<fn(QueryCtxt<'tcx>, SerializedDepNodeIndex) -> Option<Self::Value>> + = should_ever_cache_on_disk!([$($modifiers)*]); + type Cache = query_storage::$name<'tcx>; #[inline(always)] |
