Skip to content

Commit 0547a62

Browse files
committed
Directly check provenance from the AllocId.
1 parent bde946a commit 0547a62

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_mir_transform/src

1 file changed

+1
-1
lines changed

compiler/rustc_mir_transform/src/gvn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ fn op_to_prop_const<'tcx>(
940940
// Check that we do not leak a pointer.
941941
// Those pointers may lose part of their identity in codegen.
942942
// See https://github.com/rust-lang/rust/issues/79738.
943-
if !value.may_have_provenance(*ecx.tcx, op.layout.size) {
943+
if ecx.tcx.global_alloc(alloc_id).unwrap_memory().inner().provenance().ptrs().is_empty() {
944944
return Some(value);
945945
}
946946

0 commit comments

Comments
 (0)