@@ -328,7 +328,6 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {
328328
329329 let mut query_stream = quote ! { } ;
330330 let mut query_description_stream = quote ! { } ;
331- let mut all_names = quote ! { } ;
332331 let mut cached_queries = quote ! { } ;
333332
334333 for query in queries. 0 {
@@ -384,6 +383,10 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {
384383 if let Some ( remap_env_constness) = & modifiers. remap_env_constness {
385384 attributes. push ( quote ! { ( #remap_env_constness) } ) ;
386385 }
386+ // Pass on the const modifier
387+ if modifiers. cache . is_some ( ) {
388+ attributes. push ( quote ! { ( cache) } ) ;
389+ }
387390
388391 // This uses the span of the query definition for the commas,
389392 // which can be important if we later encounter any ambiguity
@@ -400,38 +403,20 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {
400403 [ #attribute_stream] fn #name( #arg) #result,
401404 } ) ;
402405
403- all_names. extend ( quote ! {
404- #( #doc_comments) *
405- #name,
406- } ) ;
407-
408406 add_query_description_impl ( & query, & mut query_description_stream) ;
409407 }
410408
411409 TokenStream :: from ( quote ! {
412410 #[ macro_export]
413411 macro_rules! rustc_query_append {
414- ( $macro: ident!) => {
412+ ( $macro: ident! $ ( [ $ ( $other : tt ) * ] ) ? ) => {
415413 $macro! {
414+ $( $( $other) * ) ?
416415 #query_stream
417416 }
418417 }
419418 }
420- #[ macro_export]
421- macro_rules! rustc_query_names {
422- ( $macro: ident! $( [ $( $other: tt) * ] ) ?) => {
423- $macro!(
424- $( $( $other) * ) ?
425- #all_names
426- ) ;
427- }
428- }
429- #[ macro_export]
430- macro_rules! rustc_cached_queries {
431- ( $macro: ident!) => {
432- $macro!( #cached_queries) ;
433- }
434- }
419+
435420 #[ macro_export]
436421 macro_rules! rustc_query_description {
437422 #query_description_stream
0 commit comments