diff options
| author | Joshua Nelson <jnelson@cloudflare.com> | 2022-09-01 22:20:17 -0500 |
|---|---|---|
| committer | Joshua Nelson <jnelson@cloudflare.com> | 2022-09-09 20:20:12 -0500 |
| commit | b164dbc2715aa15be5c9f363a00d71e0847b2e77 (patch) | |
| tree | 420810f46226211efb07001fb2eb7616fc2e2bb8 /compiler/rustc_macros/src/query.rs | |
| parent | 112419c9f0b7f369df149e002429c85fc05f5e86 (diff) | |
| download | rust-b164dbc2715aa15be5c9f363a00d71e0847b2e77.tar.gz rust-b164dbc2715aa15be5c9f363a00d71e0847b2e77.zip | |
Don't create a new `try_load_from_disk` closure for each query
Instead, define a single function, parameterized only by the return type.
Diffstat (limited to 'compiler/rustc_macros/src/query.rs')
| -rw-r--r-- | compiler/rustc_macros/src/query.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_macros/src/query.rs b/compiler/rustc_macros/src/query.rs index 50bd95834b1..55d23ba1c67 100644 --- a/compiler/rustc_macros/src/query.rs +++ b/compiler/rustc_macros/src/query.rs @@ -255,7 +255,7 @@ fn add_query_description_impl(query: &Query, impls: &mut proc_macro2::TokenStrea } const TRY_LOAD_FROM_DISK: Option<fn(QueryCtxt<'tcx>, SerializedDepNodeIndex) -> Option<Self::Value>> - = Some(|tcx, id| tcx.on_disk_cache().as_ref()?.try_load_query_result(*tcx, id)); + = Some(crate::plumbing::try_load_from_disk::<Self::Value>); } } else { quote! { |
