mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
use deref on ImmTy
This commit is contained in:
parent
82217a6587
commit
8a5273bc99
@ -121,11 +121,10 @@ fn const_to_valtree_inner<'tcx>(
|
||||
ty::Slice(_) | ty::Str => {
|
||||
match ecx.try_read_immediate_from_mplace(&place) {
|
||||
Ok(Some(imm)) => {
|
||||
let mplace_ref = ecx.ref_to_mplace(&imm).unwrap();
|
||||
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) => {
|
||||
let len = b.to_machine_usize(&ecx.tcx.tcx).unwrap();
|
||||
len
|
||||
|
@ -98,7 +98,7 @@ impl<'tcx, Tag: Provenance> Immediate<Tag> {
|
||||
// as input for binary and cast operations.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub struct ImmTy<'tcx, Tag: Provenance = AllocId> {
|
||||
pub(crate) imm: Immediate<Tag>,
|
||||
imm: Immediate<Tag>,
|
||||
pub layout: TyAndLayout<'tcx>,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user