@@ -168,11 +168,11 @@ macro_rules! separate_provide_extern_default {
168168}
169169
170170macro_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( )
174174 } ;
175- ( [ $other: tt $( $modifiers: tt) * ] [ $name: ident ] ) => {
175+ ( [ $other: tt $( $modifiers: tt) * ] [ $name: expr ] ) => {
176176 opt_remap_env_constness!( [ $( $modifiers) * ] [ $name] )
177177 } ;
178178}
@@ -276,9 +276,7 @@ macro_rules! define_callbacks {
276276 $( $( #[ $attr] ) *
277277 #[ inline( always) ]
278278 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( ) ;
282280 match try_get_cached( self . tcx, & self . tcx. query_system. caches. $name, & key) {
283281 Some ( _) => return ,
284282 None => self . tcx. queries. $name( self . tcx, DUMMY_SP , key, QueryMode :: Ensure ) ,
@@ -301,9 +299,7 @@ macro_rules! define_callbacks {
301299 #[ inline( always) ]
302300 pub fn $name( self , key: query_helper_param_ty!( $( $K) * ) ) -> $V
303301 {
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( ) ;
307303 match try_get_cached( self . tcx, & self . tcx. query_system. caches. $name, & key) {
308304 Some ( value) => value,
309305 None => self . tcx. queries. $name( self . tcx, self . span, key, QueryMode :: Get ) . unwrap( ) ,
@@ -394,9 +390,7 @@ macro_rules! define_feedable {
394390 $( #[ $attr] ) *
395391 #[ inline( always) ]
396392 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( ) ;
400394 let tcx = self . tcx;
401395 let value = query_provided_to_value:: $name( tcx, value) ;
402396 let cache = & tcx. query_system. caches. $name;
0 commit comments