diff options
| author | Ralf Jung <post@ralfj.de> | 2023-07-25 22:35:07 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-07-25 22:35:07 +0200 |
| commit | da3f0d0eb7ced3d4967dcac01ddd2edef8f43b85 (patch) | |
| tree | 0e08e8b822bbf9def79446e844cb41fb756a9842 /compiler/rustc_const_eval/src/const_eval/valtrees.rs | |
| parent | 77ff1b83cd3279c348312e1e1f9bf6a1c1174178 (diff) | |
| download | rust-da3f0d0eb7ced3d4967dcac01ddd2edef8f43b85.tar.gz rust-da3f0d0eb7ced3d4967dcac01ddd2edef8f43b85.zip | |
make MPlaceTy non-Copy
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval/valtrees.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/valtrees.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/valtrees.rs b/compiler/rustc_const_eval/src/const_eval/valtrees.rs index be5eb1558cf..8f68f837759 100644 --- a/compiler/rustc_const_eval/src/const_eval/valtrees.rs +++ b/compiler/rustc_const_eval/src/const_eval/valtrees.rs @@ -21,7 +21,7 @@ fn branches<'tcx>( ) -> ValTreeCreationResult<'tcx> { let place = match variant { Some(variant) => ecx.project_downcast(place, variant).unwrap(), - None => *place, + None => place.clone(), }; let variant = variant.map(|variant| Some(ty::ValTree::Leaf(ScalarInt::from(variant.as_u32())))); debug!(?place, ?variant); @@ -290,7 +290,7 @@ pub fn valtree_to_const_value<'tcx>( debug!(?place); valtree_into_mplace(&mut ecx, &mut place, valtree); - dump_place(&ecx, place.into()); + dump_place(&ecx, place.clone().into()); intern_const_alloc_recursive(&mut ecx, InternKind::Constant, &place).unwrap(); match ty.kind() { @@ -352,7 +352,7 @@ fn valtree_into_mplace<'tcx>( debug!(?pointee_place); valtree_into_mplace(ecx, &mut pointee_place, valtree); - dump_place(ecx, pointee_place.into()); + dump_place(ecx, pointee_place.clone().into()); intern_const_alloc_recursive(ecx, InternKind::Constant, &pointee_place).unwrap(); let imm = match inner_ty.kind() { @@ -389,7 +389,7 @@ fn valtree_into_mplace<'tcx>( Some(variant_idx), ) } - _ => (*place, branches, None), + _ => (place.clone(), branches, None), }; debug!(?place_adjusted, ?branches); |
