1
Fork 0

use AllocId instead of Allocation in ConstValue::ByRef

This commit is contained in:
Ralf Jung 2023-09-11 20:01:48 +02:00
parent c728bf3963
commit 551f481ffb
15 changed files with 80 additions and 63 deletions

View file

@ -139,7 +139,6 @@ impl EnumSizeOpt {
let (adt_def, num_variants, alloc_id) =
self.candidate(tcx, param_env, ty, &mut alloc_cache)?;
let alloc = tcx.global_alloc(alloc_id).unwrap_memory();
let tmp_ty = Ty::new_array(tcx, tcx.types.usize, num_variants as u64);
@ -154,7 +153,7 @@ impl EnumSizeOpt {
span,
user_ty: None,
literal: ConstantKind::Val(
interpret::ConstValue::ByRef { alloc, offset: Size::ZERO },
interpret::ConstValue::ByRef { alloc_id, offset: Size::ZERO },
tmp_ty,
),
};