1
Fork 0

Directly check provenance from the AllocId.

This commit is contained in:
Camille GILLOT 2023-10-23 19:37:01 +00:00
parent 72f0e0e795
commit 856161886a

View file

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