@@ -137,7 +137,7 @@ pub fn op_to_const<'tcx>(
137
137
Ok ( ty:: Const :: from_const_value ( ecx. tcx . tcx , val, op. layout . ty ) )
138
138
}
139
139
140
- pub fn const_to_op < ' tcx > (
140
+ pub fn lazy_const_to_op < ' tcx > (
141
141
ecx : & CompileTimeEvalContext < ' _ , ' _ , ' tcx > ,
142
142
cnst : ty:: LazyConst < ' tcx > ,
143
143
ty : ty:: Ty < ' tcx > ,
@@ -516,7 +516,7 @@ pub fn const_field<'a, 'tcx>(
516
516
let ecx = mk_eval_cx ( tcx, instance, param_env) . unwrap ( ) ;
517
517
let result = ( || {
518
518
// 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 ) ?;
520
520
// downcast
521
521
let down = match variant {
522
522
None => op,
@@ -543,7 +543,7 @@ pub fn const_variant_index<'a, 'tcx>(
543
543
) -> EvalResult < ' tcx , VariantIdx > {
544
544
trace ! ( "const_variant_index: {:?}, {:?}" , instance, val) ;
545
545
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 ) ?;
547
547
Ok ( ecx. read_discriminant ( op) ?. 1 )
548
548
}
549
549
0 commit comments