@@ -344,43 +344,26 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {
344
344
345
345
let mut attributes = Vec :: new ( ) ;
346
346
347
- // Pass on the fatal_cycle modifier
348
- if let Some ( fatal_cycle) = & modifiers. fatal_cycle {
349
- attributes. push ( quote ! { ( #fatal_cycle) } ) ;
350
- } ;
351
- // Pass on the arena modifier
352
- if let Some ( ref arena_cache) = modifiers. arena_cache {
353
- attributes. push ( quote ! { span=> ( #arena_cache) } ) ;
354
- } ;
355
- // Pass on the cycle_delay_bug modifier
356
- if let Some ( cycle_delay_bug) = & modifiers. cycle_delay_bug {
357
- attributes. push ( quote ! { ( #cycle_delay_bug) } ) ;
358
- } ;
359
- // Pass on the no_hash modifier
360
- if let Some ( no_hash) = & modifiers. no_hash {
361
- attributes. push ( quote ! { ( #no_hash) } ) ;
362
- } ;
363
- // Pass on the anon modifier
364
- if let Some ( anon) = & modifiers. anon {
365
- attributes. push ( quote ! { ( #anon) } ) ;
366
- } ;
367
- // Pass on the eval_always modifier
368
- if let Some ( eval_always) = & modifiers. eval_always {
369
- attributes. push ( quote ! { ( #eval_always) } ) ;
370
- } ;
371
- // Pass on the depth_limit modifier
372
- if let Some ( depth_limit) = & modifiers. depth_limit {
373
- attributes. push ( quote ! { ( #depth_limit) } ) ;
374
- } ;
375
- // Pass on the separate_provide_extern modifier
376
- if let Some ( separate_provide_extern) = & modifiers. separate_provide_extern {
377
- attributes. push ( quote ! { ( #separate_provide_extern) } ) ;
378
- }
379
- // Pass on the remap_env_constness modifier
380
- if let Some ( remap_env_constness) = & modifiers. remap_env_constness {
381
- attributes. push ( quote ! { ( #remap_env_constness) } ) ;
347
+ macro_rules! passthrough {
348
+ ( $( $modifier: ident ) ,+ $( , ) ? ) => {
349
+ $( if let Some ( $modifier) = & modifiers. $modifier {
350
+ attributes. push( quote! { ( #$modifier) } ) ;
351
+ } ; ) +
352
+ }
382
353
}
383
354
355
+ passthrough ! (
356
+ fatal_cycle,
357
+ arena_cache,
358
+ cycle_delay_bug,
359
+ no_hash,
360
+ anon,
361
+ eval_always,
362
+ depth_limit,
363
+ separate_provide_extern,
364
+ remap_env_constness,
365
+ ) ;
366
+
384
367
// This uses the span of the query definition for the commas,
385
368
// which can be important if we later encounter any ambiguity
386
369
// errors with any of the numerous macro_rules! macros that
0 commit comments