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:
@@ -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! {
|
||||
|
||||
Reference in New Issue
Block a user