diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2025-04-29 17:55:17 +1000 | 
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2025-04-29 20:48:51 +1000 | 
| commit | 64bcf3b9f66e9bc070e2d1b1ee7e643ba098f880 (patch) | |
| tree | e566d76571a11bda3faf523be09a50a7d604c0ab /compiler/rustc_macros/src | |
| parent | 4c83e55e2d88ff93155be2784b9f64b91b870e99 (diff) | |
| download | rust-64bcf3b9f66e9bc070e2d1b1ee7e643ba098f880.tar.gz rust-64bcf3b9f66e9bc070e2d1b1ee7e643ba098f880.zip | |
Rename `rustc_query_append!` to `rustc_with_all_queries!`
Diffstat (limited to 'compiler/rustc_macros/src')
| -rw-r--r-- | compiler/rustc_macros/src/query.rs | 18 | 
1 files changed, 15 insertions, 3 deletions
| diff --git a/compiler/rustc_macros/src/query.rs b/compiler/rustc_macros/src/query.rs index 62bf34ad5ad..33fb13e23bf 100644 --- a/compiler/rustc_macros/src/query.rs +++ b/compiler/rustc_macros/src/query.rs @@ -407,11 +407,23 @@ pub(super) fn rustc_queries(input: TokenStream) -> TokenStream { } TokenStream::from(quote! { + /// Higher-order macro that invokes the specified macro with a prepared + /// list of all query signatures (including modifiers). + /// + /// This allows multiple simpler macros to each have access to the list + /// of queries. #[macro_export] - macro_rules! rustc_query_append { - ($macro:ident! $( [$($other:tt)*] )?) => { + macro_rules! rustc_with_all_queries { + ( + // The macro to invoke once, on all queries (plus extras). + $macro:ident! + + // Within [], an optional list of extra "query" signatures to + // pass to the given macro, in addition to the actual queries. + $( [$($extra_fake_queries:tt)*] )? + ) => { $macro! { - $( $($other)* )? + $( $($extra_fake_queries)* )? #query_stream } } | 
