about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-24 03:35:47 +0000
committerbors <bors@rust-lang.org>2025-07-24 03:35:47 +0000
commit3c30dbbe31bfbf6029f4534170165ba573ff0fd1 (patch)
tree4a36a0eeea740125b3e6f4e740a904294e748a98 /compiler/rustc_mir_transform/src
parentefd420c770bb179537c01063e98cb6990c439654 (diff)
parent967ba2f93d4874f920cb8732724a045b18f525c8 (diff)
downloadrust-3c30dbbe31bfbf6029f4534170165ba573ff0fd1.tar.gz
rust-3c30dbbe31bfbf6029f4534170165ba573ff0fd1.zip
Auto merge of #116707 - cjgillot:slice-id, r=oli-obk,RalfJung
Create an `AllocId` for `ConstValue::Slice`.

This PR modifies `ConstValue::Slice` to use an `AllocId` instead of directly manipulating the allocation. This was originally proposed by https://github.com/rust-lang/rust/pull/115764 but was a perf regression.

Almost 2 years later, enough code has changed to make this a perf improvement: https://github.com/rust-lang/rust/pull/116707#issuecomment-3067158777
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/gvn.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/gvn.rs b/compiler/rustc_mir_transform/src/gvn.rs
index 6657f89ceb5..dc99b67a1e8 100644
--- a/compiler/rustc_mir_transform/src/gvn.rs
+++ b/compiler/rustc_mir_transform/src/gvn.rs
@@ -1542,7 +1542,7 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
 fn op_to_prop_const<'tcx>(
     ecx: &mut InterpCx<'tcx, DummyMachine>,
     op: &OpTy<'tcx>,
-) -> Option<ConstValue<'tcx>> {
+) -> Option<ConstValue> {
     // Do not attempt to propagate unsized locals.
     if op.layout.is_unsized() {
         return None;