@@ -290,7 +290,7 @@ pub fn eval_static_initializer_provider<'tcx>(
290290 // they do not have to behave "as if" they were evaluated at runtime.
291291 CompileTimeInterpreter :: new ( CanAccessMutGlobal :: Yes , CheckAlignment :: Error ) ,
292292 ) ;
293- eval_in_interpreter ( ecx, cid, true )
293+ eval_in_interpreter ( ecx, cid)
294294}
295295
296296pub trait InterpretationResult < ' tcx > {
@@ -349,24 +349,20 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
349349 // so we have to reject reading mutable global memory.
350350 CompileTimeInterpreter :: new ( CanAccessMutGlobal :: from ( is_static) , CheckAlignment :: Error ) ,
351351 ) ;
352- eval_in_interpreter ( ecx, cid, is_static )
352+ eval_in_interpreter ( ecx, cid)
353353}
354354
355355fn eval_in_interpreter < ' mir , ' tcx , R : InterpretationResult < ' tcx > > (
356356 mut ecx : InterpCx < ' mir , ' tcx , CompileTimeInterpreter < ' mir , ' tcx > > ,
357357 cid : GlobalId < ' tcx > ,
358- is_static : bool ,
359358) -> Result < R , ErrorHandled > {
360- // `is_static` just means "in static", it could still be a promoted!
361- debug_assert_eq ! ( is_static, ecx. tcx. static_mutability( cid. instance. def_id( ) ) . is_some( ) ) ;
362-
363359 let res = ecx. load_mir ( cid. instance . def , cid. promoted ) ;
364360 match res. and_then ( |body| eval_body_using_ecx ( & mut ecx, cid, body) ) {
365361 Err ( error) => {
366362 let ( error, backtrace) = error. into_parts ( ) ;
367363 backtrace. print_backtrace ( ) ;
368364
369- let ( kind, instance) = if is_static {
365+ let ( kind, instance) = if ecx . tcx . is_static ( cid . instance . def_id ( ) ) {
370366 ( "static" , String :: new ( ) )
371367 } else {
372368 // If the current item has generics, we'd like to enrich the message with the
0 commit comments