@@ -292,7 +292,7 @@ pub fn eval_to_const_value_raw_provider<'tcx>(
292292 tcx : TyCtxt < ' tcx > ,
293293 key : ty:: PseudoCanonicalInput < ' tcx , GlobalId < ' tcx > > ,
294294) -> :: rustc_middle:: mir:: interpret:: EvalToConstValueResult < ' tcx > {
295- if let Some ( ( value, _ty) ) = tcx. is_trivial_const ( key. value . instance . def_id ( ) ) {
295+ if let Some ( ( value, _ty) ) = tcx. trivial_const ( key. value . instance . def_id ( ) ) {
296296 return Ok ( value) ;
297297 }
298298 tcx. eval_to_allocation_raw ( key) . map ( |val| turn_into_const_value ( tcx, val, key) )
@@ -359,7 +359,6 @@ fn eval_in_interpreter<'tcx, R: InterpretationResult<'tcx>>(
359359 typing_env : ty:: TypingEnv < ' tcx > ,
360360) -> Result < R , ErrorHandled > {
361361 let def = cid. instance . def . def_id ( ) ;
362-
363362 let is_static = tcx. is_static ( def) ;
364363
365364 let mut ecx = InterpCx :: new (
@@ -373,7 +372,7 @@ fn eval_in_interpreter<'tcx, R: InterpretationResult<'tcx>>(
373372 CompileTimeMachine :: new ( CanAccessMutGlobal :: from ( is_static) , CheckAlignment :: Error ) ,
374373 ) ;
375374
376- if let Some ( ( value, ty) ) = tcx. is_trivial_const ( def) {
375+ if let Some ( ( value, ty) ) = tcx. trivial_const ( def) {
377376 let layout = ecx. layout_of ( ty) . unwrap ( ) ;
378377 let opty = ecx. const_val_to_op ( value, ty, Some ( layout) ) . unwrap ( ) ;
379378 let res = ecx. allocate ( layout, MemoryKind :: Stack ) . unwrap ( ) ;
0 commit comments