diff --git a/compiler/rustc_macros/src/query.rs b/compiler/rustc_macros/src/query.rs index 2a1bb10fdfc..046a144913e 100644 --- a/compiler/rustc_macros/src/query.rs +++ b/compiler/rustc_macros/src/query.rs @@ -344,7 +344,6 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream { #name, }); } - all_names.extend(quote! { #name, }); let mut attributes = Vec::new(); @@ -394,13 +393,18 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream { // be very useful. let span = name.span(); let attribute_stream = quote_spanned! {span=> #(#attributes),*}; - let doc_comments = query.doc_comments.iter(); + let doc_comments = &query.doc_comments; // Add the query to the group query_stream.extend(quote! { #(#doc_comments)* [#attribute_stream] fn #name(#arg) #result, }); + all_names.extend(quote! { + #(#doc_comments)* + #name, + }); + add_query_description_impl(&query, &mut query_description_stream); } diff --git a/compiler/rustc_middle/src/dep_graph/dep_node.rs b/compiler/rustc_middle/src/dep_graph/dep_node.rs index f54d75c24e2..21d174af444 100644 --- a/compiler/rustc_middle/src/dep_graph/dep_node.rs +++ b/compiler/rustc_middle/src/dep_graph/dep_node.rs @@ -144,7 +144,7 @@ impl DepKind { macro_rules! define_dep_nodes { ( - $( $variant:ident, )* + $( $( #[$attr:meta] )* $variant:ident, )+ ) => ( #[macro_export] macro_rules! make_dep_kind_array { @@ -155,7 +155,7 @@ macro_rules! define_dep_nodes { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Encodable, Decodable)] #[allow(non_camel_case_types)] pub enum DepKind { - $($variant),* + $( $( #[$attr] )* $variant),* } fn dep_kind_from_label_string(label: &str) -> Result { @@ -177,9 +177,9 @@ macro_rules! define_dep_nodes { } rustc_query_names!(define_dep_nodes![ - // We use this for most things when incr. comp. is turned off. + /// We use this for most things when incr. comp. is turned off. Null, - // We use this to create a forever-red node. + /// We use this to create a forever-red node. Red, TraitSelect, CompileCodegenUnit, diff --git a/compiler/rustc_query_impl/src/profiling_support.rs b/compiler/rustc_query_impl/src/profiling_support.rs index a8e0210e8d6..a9bb4756dbc 100644 --- a/compiler/rustc_query_impl/src/profiling_support.rs +++ b/compiler/rustc_query_impl/src/profiling_support.rs @@ -307,7 +307,7 @@ pub fn alloc_self_profile_query_strings(tcx: TyCtxt<'_>) { macro_rules! alloc_once { ( - $($name:ident,)* + $( $( #[$attr:meta] )* $name:ident, )+ ) => { $({ alloc_self_profile_query_strings_for_query_cache( @@ -316,7 +316,7 @@ pub fn alloc_self_profile_query_strings(tcx: TyCtxt<'_>) { &tcx.query_caches.$name, &mut string_cache, ); - })* + })+ } }