From e3538d11f1ca94737e21676a54f8de65523d614c Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Thu, 12 Oct 2023 16:15:52 +0000 Subject: [PATCH] Do not require absence of metadata. --- compiler/rustc_mir_transform/src/gvn.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_mir_transform/src/gvn.rs b/compiler/rustc_mir_transform/src/gvn.rs index 483a1b3f6df..c575da611c7 100644 --- a/compiler/rustc_mir_transform/src/gvn.rs +++ b/compiler/rustc_mir_transform/src/gvn.rs @@ -54,7 +54,7 @@ //! ``` use rustc_const_eval::interpret::{intern_const_alloc_for_constprop, MemoryKind}; -use rustc_const_eval::interpret::{ImmTy, InterpCx, MemPlaceMeta, OpTy, Projectable, Scalar}; +use rustc_const_eval::interpret::{ImmTy, InterpCx, OpTy, Projectable, Scalar}; use rustc_data_structures::fx::{FxHashMap, FxIndexSet}; use rustc_data_structures::graph::dominators::Dominators; use rustc_hir::def::DefKind; @@ -852,9 +852,7 @@ fn op_to_prop_const<'tcx>( } // If this constant is a projection of another, we can return it directly. - if let Either::Left(mplace) = op.as_mplace_or_imm() - && let MemPlaceMeta::None = mplace.meta() - { + if let Either::Left(mplace) = op.as_mplace_or_imm() { let (size, _align) = ecx.size_and_align_of_mplace(&mplace).ok()??; // Do not try interning a value that contains provenance.