@@ -517,7 +517,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
517
517
Constant ( ref constant) => {
518
518
let val =
519
519
self . subst_from_current_frame_and_normalize_erasing_regions ( constant. literal ) ;
520
- self . eval_const_to_op ( val, layout) ?
520
+ self . const_to_op ( val, layout) ?
521
521
}
522
522
} ;
523
523
trace ! ( "{:?}: {:?}" , mir_op, * op) ;
@@ -536,7 +536,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
536
536
// in patterns via the `const_eval` module
537
537
/// The `val` and `layout` are assumed to already be in our interpreter
538
538
/// "universe" (param_env).
539
- crate fn eval_const_to_op (
539
+ crate fn const_to_op (
540
540
& self ,
541
541
val : & ty:: Const < ' tcx > ,
542
542
layout : Option < TyAndLayout < ' tcx > > ,
@@ -559,16 +559,12 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
559
559
// potentially requiring the current static to be evaluated again. This is not a
560
560
// problem here, because we are building an operand which means an actual read is
561
561
// happening.
562
- //
563
- // The machine callback `adjust_global_const` below is guaranteed to
564
- // be called for all constants because `const_eval` calls
565
- // `eval_const_to_op` recursively.
566
562
return Ok ( self . const_eval ( GlobalId { instance, promoted } , val. ty ) ?) ;
567
563
}
568
564
ty:: ConstKind :: Infer ( ..)
569
565
| ty:: ConstKind :: Bound ( ..)
570
566
| ty:: ConstKind :: Placeholder ( ..) => {
571
- span_bug ! ( self . cur_span( ) , "eval_const_to_op : Unexpected ConstKind {:?}" , val)
567
+ span_bug ! ( self . cur_span( ) , "const_to_op : Unexpected ConstKind {:?}" , val)
572
568
}
573
569
ty:: ConstKind :: Value ( val_val) => val_val,
574
570
} ;
0 commit comments