Skip to content

Commit b061550

Browse files
committed
Remove the $tcx:tt parameter from rustc_query_description
It's unnecessary.
1 parent 7b8e2a5 commit b061550

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler/rustc_macros/src/query.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,13 @@ fn add_query_description_impl(query: &Query, impls: &mut proc_macro2::TokenStrea
258258
let try_load_from_disk = if let Some((tcx, id, block)) = modifiers.load_cached.as_ref() {
259259
// Use custom code to load the query from disk
260260
quote! {
261-
const TRY_LOAD_FROM_DISK: Option<fn(QueryCtxt<$tcx>, SerializedDepNodeIndex) -> Option<Self::Value>>
261+
const TRY_LOAD_FROM_DISK: Option<fn(QueryCtxt<'tcx>, SerializedDepNodeIndex) -> Option<Self::Value>>
262262
= Some(|#tcx, #id| { #block });
263263
}
264264
} else {
265265
// Use the default code to load the query from disk
266266
quote! {
267-
const TRY_LOAD_FROM_DISK: Option<fn(QueryCtxt<$tcx>, SerializedDepNodeIndex) -> Option<Self::Value>>
267+
const TRY_LOAD_FROM_DISK: Option<fn(QueryCtxt<'tcx>, SerializedDepNodeIndex) -> Option<Self::Value>>
268268
= Some(|tcx, id| tcx.on_disk_cache().as_ref()?.try_load_query_result(*tcx, id));
269269
}
270270
};
@@ -291,7 +291,7 @@ fn add_query_description_impl(query: &Query, impls: &mut proc_macro2::TokenStrea
291291
false
292292
}
293293

294-
const TRY_LOAD_FROM_DISK: Option<fn(QueryCtxt<$tcx>, SerializedDepNodeIndex) -> Option<Self::Value>> = None;
294+
const TRY_LOAD_FROM_DISK: Option<fn(QueryCtxt<'tcx>, SerializedDepNodeIndex) -> Option<Self::Value>> = None;
295295
}
296296
};
297297

@@ -300,7 +300,7 @@ fn add_query_description_impl(query: &Query, impls: &mut proc_macro2::TokenStrea
300300

301301
let desc = quote! {
302302
#[allow(unused_variables)]
303-
fn describe(tcx: QueryCtxt<$tcx>, key: Self::Key) -> String {
303+
fn describe(tcx: QueryCtxt<'tcx>, key: Self::Key) -> String {
304304
let (#tcx, #key) = (*tcx, key);
305305
::rustc_middle::ty::print::with_no_trimmed_paths!(
306306
format!(#desc)
@@ -309,7 +309,7 @@ fn add_query_description_impl(query: &Query, impls: &mut proc_macro2::TokenStrea
309309
};
310310

311311
impls.extend(quote! {
312-
(#name<$tcx:tt>) => {
312+
(#name) => {
313313
#desc
314314
#cache
315315
};

compiler/rustc_query_impl/src/plumbing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ macro_rules! define_queries {
322322
}
323323

324324
impl<'tcx> QueryDescription<QueryCtxt<'tcx>> for queries::$name<'tcx> {
325-
rustc_query_description! { $name<'tcx> }
325+
rustc_query_description! { $name }
326326

327327
type Cache = query_storage::$name<'tcx>;
328328

0 commit comments

Comments
 (0)