Support doc-comments in define_dep_nodes

This commit is contained in:
Joshua Nelson 2022-08-29 18:46:56 -05:00
parent 05886e28a4
commit c630c87ceb
3 changed files with 12 additions and 8 deletions

View file

@ -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);
}