@@ -75,7 +75,7 @@ pub(crate) fn codegen_tls_ref<'tcx>(
75
75
pub ( crate ) fn eval_mir_constant < ' tcx > (
76
76
fx : & FunctionCx < ' _ , ' _ , ' tcx > ,
77
77
constant : & ConstOperand < ' tcx > ,
78
- ) -> ( ConstValue < ' tcx > , Ty < ' tcx > ) {
78
+ ) -> ( ConstValue , Ty < ' tcx > ) {
79
79
let cv = fx. monomorphize ( constant. const_ ) ;
80
80
// This cannot fail because we checked all required_consts in advance.
81
81
let val = cv
@@ -94,7 +94,7 @@ pub(crate) fn codegen_constant_operand<'tcx>(
94
94
95
95
pub ( crate ) fn codegen_const_value < ' tcx > (
96
96
fx : & mut FunctionCx < ' _ , ' _ , ' tcx > ,
97
- const_val : ConstValue < ' tcx > ,
97
+ const_val : ConstValue ,
98
98
ty : Ty < ' tcx > ,
99
99
) -> CValue < ' tcx > {
100
100
let layout = fx. layout_of ( ty) ;
@@ -220,8 +220,7 @@ pub(crate) fn codegen_const_value<'tcx>(
220
220
. offset_i64 ( fx, i64:: try_from ( offset. bytes ( ) ) . unwrap ( ) ) ,
221
221
layout,
222
222
) ,
223
- ConstValue :: Slice { data, meta } => {
224
- let alloc_id = fx. tcx . reserve_and_set_memory_alloc ( data) ;
223
+ ConstValue :: Slice { alloc_id, meta } => {
225
224
let ptr = pointer_for_allocation ( fx, alloc_id) ;
226
225
let len = fx. bcx . ins ( ) . iconst ( fx. pointer_type , meta as i64 ) ;
227
226
CValue :: by_val_pair ( ptr, len, layout)
0 commit comments