@@ -137,7 +137,7 @@ pub fn op_to_const<'tcx>(
137137 Ok ( ty:: Const :: from_const_value ( ecx. tcx . tcx , val, op. layout . ty ) )
138138}
139139
140- pub fn const_to_op < ' tcx > (
140+ pub fn lazy_const_to_op < ' tcx > (
141141 ecx : & CompileTimeEvalContext < ' _ , ' _ , ' tcx > ,
142142 cnst : ty:: LazyConst < ' tcx > ,
143143 ty : ty:: Ty < ' tcx > ,
@@ -516,7 +516,7 @@ pub fn const_field<'a, 'tcx>(
516516 let ecx = mk_eval_cx ( tcx, instance, param_env) . unwrap ( ) ;
517517 let result = ( || {
518518 // get the operand again
519- let op = const_to_op ( & ecx, ty:: LazyConst :: Evaluated ( value) , value. ty ) ?;
519+ let op = lazy_const_to_op ( & ecx, ty:: LazyConst :: Evaluated ( value) , value. ty ) ?;
520520 // downcast
521521 let down = match variant {
522522 None => op,
@@ -543,7 +543,7 @@ pub fn const_variant_index<'a, 'tcx>(
543543) -> EvalResult < ' tcx , VariantIdx > {
544544 trace ! ( "const_variant_index: {:?}, {:?}" , instance, val) ;
545545 let ecx = mk_eval_cx ( tcx, instance, param_env) . unwrap ( ) ;
546- let op = const_to_op ( & ecx, ty:: LazyConst :: Evaluated ( val) , val. ty ) ?;
546+ let op = lazy_const_to_op ( & ecx, ty:: LazyConst :: Evaluated ( val) , val. ty ) ?;
547547 Ok ( ecx. read_discriminant ( op) ?. 1 )
548548}
549549
0 commit comments