mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Do not intern if we have provenance.
This commit is contained in:
parent
98c1ea8e82
commit
4067795d8c
@ -1389,8 +1389,13 @@ fn op_to_prop_const<'tcx>(
|
||||
// If this constant has scalar ABI, return it as a `ConstValue::Scalar`.
|
||||
if let Abi::Scalar(abi::Scalar::Initialized { .. }) = op.layout.abi
|
||||
&& let Ok(scalar) = ecx.read_scalar(op)
|
||||
&& scalar.try_to_scalar_int().is_ok()
|
||||
{
|
||||
if !scalar.try_to_scalar_int().is_ok() {
|
||||
// Check that we do not leak a pointer.
|
||||
// Those pointers may lose part of their identity in codegen.
|
||||
// FIXME: remove this hack once https://github.com/rust-lang/rust/issues/79738 is fixed.
|
||||
return None;
|
||||
}
|
||||
return Some(ConstValue::Scalar(scalar));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user