about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/const_eval
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-06-29 17:07:24 -0400
committerRalf Jung <post@ralfj.de>2022-06-29 17:13:13 -0400
commitf60ec83779a7c41e1a4e8378017ba68669eb81ee (patch)
treed54d6f4458708ee9277f6c9d2ad432e6344dc378 /compiler/rustc_const_eval/src/const_eval
parent66c83ffca1512ed76f9445ec7f7280f768ef71c4 (diff)
downloadrust-f60ec83779a7c41e1a4e8378017ba68669eb81ee.tar.gz
rust-f60ec83779a7c41e1a4e8378017ba68669eb81ee.zip
interpret: add From<&MplaceTy> for PlaceTy
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval')
-rw-r--r--compiler/rustc_const_eval/src/const_eval/valtrees.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/valtrees.rs b/compiler/rustc_const_eval/src/const_eval/valtrees.rs
index 4849a07e3b4..f8b390aaf50 100644
--- a/compiler/rustc_const_eval/src/const_eval/valtrees.rs
+++ b/compiler/rustc_const_eval/src/const_eval/valtrees.rs
@@ -346,7 +346,7 @@ fn valtree_into_mplace<'tcx>(
         ty::FnDef(_, _) => {
             ecx.write_immediate(
                 Immediate::Scalar(ScalarMaybeUninit::Scalar(Scalar::ZST)),
-                &(*place).into(),
+                &place.into(),
             )
             .unwrap();
         }
@@ -355,7 +355,7 @@ fn valtree_into_mplace<'tcx>(
             debug!("writing trivial valtree {:?} to place {:?}", scalar_int, place);
             ecx.write_immediate(
                 Immediate::Scalar(ScalarMaybeUninit::Scalar(scalar_int.into())),
-                &(*place).into(),
+                &place.into(),
             )
             .unwrap();
         }
@@ -382,7 +382,7 @@ fn valtree_into_mplace<'tcx>(
             };
             debug!(?imm);
 
-            ecx.write_immediate(imm, &(*place).into()).unwrap();
+            ecx.write_immediate(imm, &place.into()).unwrap();
         }
         ty::Adt(_, _) | ty::Tuple(_) | ty::Array(_, _) | ty::Str | ty::Slice(_) => {
             let branches = valtree.unwrap_branch();
@@ -464,11 +464,11 @@ fn valtree_into_mplace<'tcx>(
 
             if let Some(variant_idx) = variant_idx {
                 // don't forget filling the place with the discriminant of the enum
-                ecx.write_discriminant(variant_idx, &(*place).into()).unwrap();
+                ecx.write_discriminant(variant_idx, &place.into()).unwrap();
             }
 
             debug!("dump of place after writing discriminant:");
-            dump_place(ecx, (*place).into());
+            dump_place(ecx, place.into());
         }
         _ => bug!("shouldn't have created a ValTree for {:?}", ty),
     }