mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Remove the $tcx:tt
parameter from rustc_query_description
It's unnecessary.
This commit is contained in:
parent
7b8e2a52ff
commit
b061550ed3
@ -258,13 +258,13 @@ fn add_query_description_impl(query: &Query, impls: &mut proc_macro2::TokenStrea
|
||||
let try_load_from_disk = if let Some((tcx, id, block)) = modifiers.load_cached.as_ref() {
|
||||
// Use custom code to load the query from disk
|
||||
quote! {
|
||||
const TRY_LOAD_FROM_DISK: Option<fn(QueryCtxt<$tcx>, SerializedDepNodeIndex) -> Option<Self::Value>>
|
||||
const TRY_LOAD_FROM_DISK: Option<fn(QueryCtxt<'tcx>, SerializedDepNodeIndex) -> Option<Self::Value>>
|
||||
= Some(|#tcx, #id| { #block });
|
||||
}
|
||||
} else {
|
||||
// Use the default code to load the query from disk
|
||||
quote! {
|
||||
const TRY_LOAD_FROM_DISK: Option<fn(QueryCtxt<$tcx>, SerializedDepNodeIndex) -> Option<Self::Value>>
|
||||
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));
|
||||
}
|
||||
};
|
||||
@ -291,7 +291,7 @@ fn add_query_description_impl(query: &Query, impls: &mut proc_macro2::TokenStrea
|
||||
false
|
||||
}
|
||||
|
||||
const TRY_LOAD_FROM_DISK: Option<fn(QueryCtxt<$tcx>, SerializedDepNodeIndex) -> Option<Self::Value>> = None;
|
||||
const TRY_LOAD_FROM_DISK: Option<fn(QueryCtxt<'tcx>, SerializedDepNodeIndex) -> Option<Self::Value>> = None;
|
||||
}
|
||||
};
|
||||
|
||||
@ -300,7 +300,7 @@ fn add_query_description_impl(query: &Query, impls: &mut proc_macro2::TokenStrea
|
||||
|
||||
let desc = quote! {
|
||||
#[allow(unused_variables)]
|
||||
fn describe(tcx: QueryCtxt<$tcx>, key: Self::Key) -> String {
|
||||
fn describe(tcx: QueryCtxt<'tcx>, key: Self::Key) -> String {
|
||||
let (#tcx, #key) = (*tcx, key);
|
||||
::rustc_middle::ty::print::with_no_trimmed_paths!(
|
||||
format!(#desc)
|
||||
@ -309,7 +309,7 @@ fn add_query_description_impl(query: &Query, impls: &mut proc_macro2::TokenStrea
|
||||
};
|
||||
|
||||
impls.extend(quote! {
|
||||
(#name<$tcx:tt>) => {
|
||||
(#name) => {
|
||||
#desc
|
||||
#cache
|
||||
};
|
||||
|
@ -322,7 +322,7 @@ macro_rules! define_queries {
|
||||
}
|
||||
|
||||
impl<'tcx> QueryDescription<QueryCtxt<'tcx>> for queries::$name<'tcx> {
|
||||
rustc_query_description! { $name<'tcx> }
|
||||
rustc_query_description! { $name }
|
||||
|
||||
type Cache = query_storage::$name<'tcx>;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user