File tree 1 file changed +7
-3
lines changed
compiler/rustc_const_eval/src/const_eval
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>(
240
240
let place = MPlaceTy :: from_aligned_ptr_with_meta (
241
241
ptr. into ( ) ,
242
242
layout,
243
- MemPlaceMeta :: Meta ( Scalar :: from_u64 ( num_elems as u64 ) ) ,
243
+ MemPlaceMeta :: Meta ( Scalar :: from_machine_usize ( num_elems as u64 , & tcx ) ) ,
244
244
) ;
245
245
debug ! ( ?place) ;
246
246
@@ -370,7 +370,8 @@ fn valtree_into_mplace<'tcx>(
370
370
let imm = match inner_ty. kind ( ) {
371
371
ty:: Slice ( _) | ty:: Str => {
372
372
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) ) ;
374
375
375
376
Immediate :: ScalarPair (
376
377
ScalarMaybeUninit :: from_maybe_pointer ( ( * pointee_place) . ptr , & tcx) ,
@@ -441,7 +442,10 @@ fn valtree_into_mplace<'tcx>(
441
442
place
442
443
. offset (
443
444
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
+ ) ) ,
445
449
inner_layout,
446
450
& tcx,
447
451
)
You can’t perform that action at this time.
0 commit comments