Skip to content

Commit 8a5273b

Browse files
committed
use deref on ImmTy
1 parent 82217a6 commit 8a5273b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

compiler/rustc_const_eval/src/const_eval/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,10 @@ fn const_to_valtree_inner<'tcx>(
121121
ty::Slice(_) | ty::Str => {
122122
match ecx.try_read_immediate_from_mplace(&place) {
123123
Ok(Some(imm)) => {
124-
let mplace_ref = ecx.ref_to_mplace(&imm).unwrap();
125124
let derefd = ecx.deref_operand(&place.into()).expect(&format!("couldnt deref {:?}", imm));
126-
debug!(?mplace_ref, ?derefd);
125+
debug!(?derefd);
127126

128-
let len = match imm.imm {
127+
let len = match *imm {
129128
Immediate::ScalarPair(_, b) => {
130129
let len = b.to_machine_usize(&ecx.tcx.tcx).unwrap();
131130
len

compiler/rustc_const_eval/src/interpret/operand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl<'tcx, Tag: Provenance> Immediate<Tag> {
9898
// as input for binary and cast operations.
9999
#[derive(Copy, Clone, Debug)]
100100
pub struct ImmTy<'tcx, Tag: Provenance = AllocId> {
101-
pub(crate) imm: Immediate<Tag>,
101+
imm: Immediate<Tag>,
102102
pub layout: TyAndLayout<'tcx>,
103103
}
104104

0 commit comments

Comments
 (0)