@@ -88,7 +88,7 @@ pub fn value_to_const_value<'tcx>(
8888 Value :: ScalarPair ( a, b) => Ok ( ConstValue :: ScalarPair ( a, b) ) ,
8989 Value :: ByRef ( ptr, align) => {
9090 let ptr = ptr. to_ptr ( ) . unwrap ( ) ;
91- let alloc = ecx. memory ( ) . get ( ptr. alloc_id ) ?;
91+ let alloc = ecx. memory . get ( ptr. alloc_id ) ?;
9292 assert ! ( alloc. align. abi( ) >= align. abi( ) ) ;
9393 assert ! ( alloc. bytes. len( ) as u64 - ptr. offset. bytes( ) >= layout. size. bytes( ) ) ;
9494 let mut alloc = alloc. clone ( ) ;
@@ -149,7 +149,7 @@ fn eval_body_using_ecx<'a, 'mir, 'tcx>(
149149 }
150150 let layout = ecx. layout_of ( mir. return_ty ( ) . subst ( tcx, cid. instance . substs ) ) ?;
151151 assert ! ( !layout. is_unsized( ) ) ;
152- let ptr = ecx. memory_mut ( ) . allocate (
152+ let ptr = ecx. memory . allocate (
153153 layout. size ,
154154 layout. align ,
155155 MemoryKind :: Stack ,
@@ -185,6 +185,7 @@ fn eval_body_using_ecx<'a, 'mir, 'tcx>(
185185 Ok ( ( value, ptr, layout. ty ) )
186186}
187187
188+ #[ derive( Debug , Clone , Eq , PartialEq , Hash ) ]
188189pub struct CompileTimeEvaluator ;
189190
190191impl < ' tcx > Into < EvalError < ' tcx > > for ConstEvalError {
@@ -486,7 +487,7 @@ pub fn const_variant_index<'a, 'tcx>(
486487 let ( ptr, align) = match value {
487488 Value :: ScalarPair ( ..) | Value :: Scalar ( _) => {
488489 let layout = ecx. layout_of ( val. ty ) ?;
489- let ptr = ecx. memory_mut ( ) . allocate ( layout. size , layout. align , MemoryKind :: Stack ) ?. into ( ) ;
490+ let ptr = ecx. memory . allocate ( layout. size , layout. align , MemoryKind :: Stack ) ?. into ( ) ;
490491 ecx. write_value_to_ptr ( value, ptr, layout. align , val. ty ) ?;
491492 ( ptr, layout. align )
492493 } ,
@@ -515,9 +516,9 @@ pub fn const_value_to_allocation_provider<'a, 'tcx>(
515516 ( ) ) ;
516517 let value = ecx. const_to_value ( val. val ) ?;
517518 let layout = ecx. layout_of ( val. ty ) ?;
518- let ptr = ecx. memory_mut ( ) . allocate ( layout. size , layout. align , MemoryKind :: Stack ) ?;
519+ let ptr = ecx. memory . allocate ( layout. size , layout. align , MemoryKind :: Stack ) ?;
519520 ecx. write_value_to_ptr ( value, ptr. into ( ) , layout. align , val. ty ) ?;
520- let alloc = ecx. memory ( ) . get ( ptr. alloc_id ) ?;
521+ let alloc = ecx. memory . get ( ptr. alloc_id ) ?;
521522 Ok ( tcx. intern_const_alloc ( alloc. clone ( ) ) )
522523 } ;
523524 result ( ) . expect ( "unable to convert ConstValue to Allocation" )
0 commit comments