From b061550ed351751db4bb3dcc356f44daa9a3542d Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 24 Aug 2022 00:22:27 -0500 Subject: [PATCH] Remove the `$tcx:tt` parameter from `rustc_query_description` It's unnecessary. --- compiler/rustc_macros/src/query.rs | 10 +++++----- compiler/rustc_query_impl/src/plumbing.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_macros/src/query.rs b/compiler/rustc_macros/src/query.rs index d80d35cb1fa..cfbc80b9756 100644 --- a/compiler/rustc_macros/src/query.rs +++ b/compiler/rustc_macros/src/query.rs @@ -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, SerializedDepNodeIndex) -> Option> + const TRY_LOAD_FROM_DISK: Option, SerializedDepNodeIndex) -> Option> = Some(|#tcx, #id| { #block }); } } else { // Use the default code to load the query from disk quote! { - const TRY_LOAD_FROM_DISK: Option, SerializedDepNodeIndex) -> Option> + const TRY_LOAD_FROM_DISK: Option, SerializedDepNodeIndex) -> Option> = 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, SerializedDepNodeIndex) -> Option> = None; + const TRY_LOAD_FROM_DISK: Option, SerializedDepNodeIndex) -> Option> = 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 }; diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index 7b4ff850df6..462f9a42aea 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -322,7 +322,7 @@ macro_rules! define_queries { } impl<'tcx> QueryDescription> for queries::$name<'tcx> { - rustc_query_description! { $name<'tcx> } + rustc_query_description! { $name } type Cache = query_storage::$name<'tcx>;