Don't create a new try_load_from_disk
closure for each query
Instead, define a single function, parameterized only by the return type.
This commit is contained in:
parent
112419c9f0
commit
b164dbc271
3 changed files with 27 additions and 2 deletions
|
@ -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! {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue