diff options
| author | b-naber <bn263@gmx.de> | 2022-04-08 17:13:45 +0200 |
|---|---|---|
| committer | b-naber <bn263@gmx.de> | 2022-04-08 17:13:45 +0200 |
| commit | 8a5273bc995d5ac457eaf70bf3d10c1513277234 (patch) | |
| tree | 20817e878668fbc3ed6b44389f2f6ab5e1e62b12 /compiler/rustc_const_eval/src | |
| parent | 82217a6587da07433c901a8b3ea0765acf288860 (diff) | |
use deref on ImmTy
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/mod.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/operand.rs | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/mod.rs b/compiler/rustc_const_eval/src/const_eval/mod.rs index 9b42910f99c..ee763f3b0b7 100644 --- a/compiler/rustc_const_eval/src/const_eval/mod.rs +++ b/compiler/rustc_const_eval/src/const_eval/mod.rs @@ -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 diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs index 3b9fab9db43..d820bd900a0 100644 --- a/compiler/rustc_const_eval/src/interpret/operand.rs +++ b/compiler/rustc_const_eval/src/interpret/operand.rs @@ -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>, } |
