File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
compiler/rustc_const_eval/src/const_eval Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ fn create_pointee_place<'tcx>(
240240 let place = MPlaceTy :: from_aligned_ptr_with_meta (
241241 ptr. into ( ) ,
242242 layout,
243- MemPlaceMeta :: Meta ( Scalar :: from_u64 ( num_elems as u64 ) ) ,
243+ MemPlaceMeta :: Meta ( Scalar :: from_machine_usize ( num_elems as u64 , & tcx ) ) ,
244244 ) ;
245245 debug ! ( ?place) ;
246246
@@ -370,7 +370,8 @@ fn valtree_into_mplace<'tcx>(
370370 let imm = match inner_ty. kind ( ) {
371371 ty:: Slice ( _) | ty:: Str => {
372372 let len = valtree. unwrap_branch ( ) . len ( ) ;
373- let len_scalar = ScalarMaybeUninit :: Scalar ( Scalar :: from_u64 ( len as u64 ) ) ;
373+ let len_scalar =
374+ ScalarMaybeUninit :: Scalar ( Scalar :: from_machine_usize ( len as u64 , & tcx) ) ;
374375
375376 Immediate :: ScalarPair (
376377 ScalarMaybeUninit :: from_maybe_pointer ( ( * pointee_place) . ptr , & tcx) ,
@@ -441,7 +442,10 @@ fn valtree_into_mplace<'tcx>(
441442 place
442443 . offset (
443444 offset,
444- MemPlaceMeta :: Meta ( Scalar :: from_u64 ( num_elems as u64 ) ) ,
445+ MemPlaceMeta :: Meta ( Scalar :: from_machine_usize (
446+ num_elems as u64 ,
447+ & tcx,
448+ ) ) ,
445449 inner_layout,
446450 & tcx,
447451 )
You can’t perform that action at this time.
0 commit comments