use deref on ImmTy
This commit is contained in:
parent
82217a6587
commit
8a5273bc99
2 changed files with 3 additions and 4 deletions
|
@ -121,11 +121,10 @@ fn const_to_valtree_inner<'tcx>(
|
||||||
ty::Slice(_) | ty::Str => {
|
ty::Slice(_) | ty::Str => {
|
||||||
match ecx.try_read_immediate_from_mplace(&place) {
|
match ecx.try_read_immediate_from_mplace(&place) {
|
||||||
Ok(Some(imm)) => {
|
Ok(Some(imm)) => {
|
||||||
let mplace_ref = ecx.ref_to_mplace(&imm).unwrap();
|
|
||||||
let derefd = ecx.deref_operand(&place.into()).expect(&format!("couldnt deref {:?}", imm));
|
let derefd = ecx.deref_operand(&place.into()).expect(&format!("couldnt deref {:?}", imm));
|
||||||
debug!(?mplace_ref, ?derefd);
|
debug!(?derefd);
|
||||||
|
|
||||||
let len = match imm.imm {
|
let len = match *imm {
|
||||||
Immediate::ScalarPair(_, b) => {
|
Immediate::ScalarPair(_, b) => {
|
||||||
let len = b.to_machine_usize(&ecx.tcx.tcx).unwrap();
|
let len = b.to_machine_usize(&ecx.tcx.tcx).unwrap();
|
||||||
len
|
len
|
||||||
|
|
|
@ -98,7 +98,7 @@ impl<'tcx, Tag: Provenance> Immediate<Tag> {
|
||||||
// as input for binary and cast operations.
|
// as input for binary and cast operations.
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct ImmTy<'tcx, Tag: Provenance = AllocId> {
|
pub struct ImmTy<'tcx, Tag: Provenance = AllocId> {
|
||||||
pub(crate) imm: Immediate<Tag>,
|
imm: Immediate<Tag>,
|
||||||
pub layout: TyAndLayout<'tcx>,
|
pub layout: TyAndLayout<'tcx>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue