about summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src/impls/liveness.rs
diff options
context:
space:
mode:
authordianqk <dianqk@dianqk.net>2025-07-15 22:54:54 +0800
committerdianqk <dianqk@dianqk.net>2025-10-02 14:55:51 +0800
commit85b2f706939528b5796d98e82c183637f8338cd1 (patch)
tree4efb2021a7a69ef228f6dbb4a7c0df7977ebfacb /compiler/rustc_mir_dataflow/src/impls/liveness.rs
parentcc93132ae4f5477297ecddb0c07d2e8c74075f0c (diff)
downloadrust-85b2f706939528b5796d98e82c183637f8338cd1.tar.gz
rust-85b2f706939528b5796d98e82c183637f8338cd1.zip
mir-opt: Eliminate trivial unnecessary storage annotations
Diffstat (limited to 'compiler/rustc_mir_dataflow/src/impls/liveness.rs')
-rw-r--r--compiler/rustc_mir_dataflow/src/impls/liveness.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_mir_dataflow/src/impls/liveness.rs b/compiler/rustc_mir_dataflow/src/impls/liveness.rs
index 24da4b0bea2..037e2720f36 100644
--- a/compiler/rustc_mir_dataflow/src/impls/liveness.rs
+++ b/compiler/rustc_mir_dataflow/src/impls/liveness.rs
@@ -233,8 +233,10 @@ impl<'a> MaybeTransitiveLiveLocals<'a> {
         // Compute the place that we are storing to, if any
         let destination = match stmt_kind {
             StatementKind::Assign(box (place, rvalue)) => (rvalue.is_safe_to_remove()
+                // FIXME: We are not sure how we should represent this debugging information for some statements,
+                // keep it for now.
                 && (!debuginfo_locals.contains(place.local)
-                    || (place.as_local().is_some() && matches!(rvalue, mir::Rvalue::Ref(..)))))
+                    || (place.as_local().is_some() && stmt_kind.as_debuginfo().is_some())))
             .then_some(*place),
             StatementKind::SetDiscriminant { place, .. } | StatementKind::Deinit(place) => {
                 (!debuginfo_locals.contains(place.local)).then_some(**place)