@@ -168,11 +168,11 @@ macro_rules! separate_provide_extern_default {
168
168
}
169
169
170
170
macro_rules! opt_remap_env_constness {
171
- ( [ ] [ $name: ident ] ) => { } ;
172
- ( [ ( remap_env_constness) $( $rest: tt) * ] [ $name: ident ] ) => {
173
- let $name = $name . without_const( ) ;
171
+ ( [ ] [ $name: expr ] ) => { $name } ;
172
+ ( [ ( remap_env_constness) $( $rest: tt) * ] [ $name: expr ] ) => {
173
+ $name. without_const( )
174
174
} ;
175
- ( [ $other: tt $( $modifiers: tt) * ] [ $name: ident ] ) => {
175
+ ( [ $other: tt $( $modifiers: tt) * ] [ $name: expr ] ) => {
176
176
opt_remap_env_constness!( [ $( $modifiers) * ] [ $name] )
177
177
} ;
178
178
}
@@ -276,9 +276,7 @@ macro_rules! define_callbacks {
276
276
$( $( #[ $attr] ) *
277
277
#[ inline( always) ]
278
278
pub fn $name( self , key: query_helper_param_ty!( $( $K) * ) ) {
279
- let key = key. into_query_param( ) ;
280
- opt_remap_env_constness!( [ $( $modifiers) * ] [ key] ) ;
281
-
279
+ let key = opt_remap_env_constness!( [ $( $modifiers) * ] [ key] ) . into_query_param( ) ;
282
280
match try_get_cached( self . tcx, & self . tcx. query_system. caches. $name, & key) {
283
281
Some ( _) => return ,
284
282
None => self . tcx. queries. $name( self . tcx, DUMMY_SP , key, QueryMode :: Ensure ) ,
@@ -301,9 +299,7 @@ macro_rules! define_callbacks {
301
299
#[ inline( always) ]
302
300
pub fn $name( self , key: query_helper_param_ty!( $( $K) * ) ) -> $V
303
301
{
304
- let key = key. into_query_param( ) ;
305
- opt_remap_env_constness!( [ $( $modifiers) * ] [ key] ) ;
306
-
302
+ let key = opt_remap_env_constness!( [ $( $modifiers) * ] [ key] ) . into_query_param( ) ;
307
303
match try_get_cached( self . tcx, & self . tcx. query_system. caches. $name, & key) {
308
304
Some ( value) => value,
309
305
None => self . tcx. queries. $name( self . tcx, self . span, key, QueryMode :: Get ) . unwrap( ) ,
@@ -394,9 +390,7 @@ macro_rules! define_feedable {
394
390
$( #[ $attr] ) *
395
391
#[ inline( always) ]
396
392
pub fn $name( self , value: query_provided:: $name<' tcx>) -> $V {
397
- let key = self . key( ) . into_query_param( ) ;
398
- opt_remap_env_constness!( [ $( $modifiers) * ] [ key] ) ;
399
-
393
+ let key = opt_remap_env_constness!( [ $( $modifiers) * ] [ self . key( ) ] ) . into_query_param( ) ;
400
394
let tcx = self . tcx;
401
395
let value = query_provided_to_value:: $name( tcx, value) ;
402
396
let cache = & tcx. query_system. caches. $name;
0 commit comments