Wrap TyCtxt inside a QueryCtxt for queries.
This commit is contained in:
@@ -354,9 +354,10 @@ fn add_query_description_impl(
|
||||
quote! {
|
||||
#[inline]
|
||||
fn try_load_from_disk(
|
||||
#tcx: TyCtxt<'tcx>,
|
||||
#id: SerializedDepNodeIndex
|
||||
tcx: QueryCtxt<'tcx>,
|
||||
id: SerializedDepNodeIndex
|
||||
) -> Option<Self::Value> {
|
||||
let (#tcx, #id) = (*tcx, id);
|
||||
#block
|
||||
}
|
||||
}
|
||||
@@ -365,10 +366,10 @@ fn add_query_description_impl(
|
||||
quote! {
|
||||
#[inline]
|
||||
fn try_load_from_disk(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
tcx: QueryCtxt<'tcx>,
|
||||
id: SerializedDepNodeIndex
|
||||
) -> Option<Self::Value> {
|
||||
tcx.on_disk_cache.as_ref()?.try_load_query_result(tcx, id)
|
||||
tcx.on_disk_cache.as_ref()?.try_load_query_result(*tcx, id)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -393,10 +394,11 @@ fn add_query_description_impl(
|
||||
#[inline]
|
||||
#[allow(unused_variables, unused_braces)]
|
||||
fn cache_on_disk(
|
||||
#tcx: TyCtxt<'tcx>,
|
||||
#key: &Self::Key,
|
||||
#value: Option<&Self::Value>
|
||||
tcx: QueryCtxt<'tcx>,
|
||||
key: &Self::Key,
|
||||
value: Option<&Self::Value>
|
||||
) -> bool {
|
||||
let (#tcx, #key, #value) = (*tcx, key, value);
|
||||
#expr
|
||||
}
|
||||
|
||||
@@ -414,16 +416,14 @@ fn add_query_description_impl(
|
||||
|
||||
let desc = quote! {
|
||||
#[allow(unused_variables)]
|
||||
fn describe(
|
||||
#tcx: TyCtxt<'tcx>,
|
||||
#key: #arg,
|
||||
) -> String {
|
||||
::rustc_middle::ty::print::with_no_trimmed_paths(|| format!(#desc))
|
||||
fn describe(tcx: QueryCtxt<'tcx>, key: #arg) -> String {
|
||||
let (#tcx, #key) = (*tcx, key);
|
||||
::rustc_middle::ty::print::with_no_trimmed_paths(|| format!(#desc).into())
|
||||
}
|
||||
};
|
||||
|
||||
impls.extend(quote! {
|
||||
impl<'tcx> QueryDescription<TyCtxt<'tcx>> for queries::#name<'tcx> {
|
||||
impl<'tcx> QueryDescription<QueryCtxt<'tcx>> for queries::#name<'tcx> {
|
||||
#desc
|
||||
#cache
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user