From bce7f715890175437896ce3419af1d9a9585aaf3 Mon Sep 17 00:00:00 2001 From: beepster4096 <19316085+beepster4096@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:10:50 -0700 Subject: [PATCH] make move unwrap_binder! a move subpath --- compiler/rustc_mir_dataflow/src/move_paths/builder.rs | 1 + compiler/rustc_mir_dataflow/src/move_paths/mod.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs index 8342c509c141..b45f8a724c69 100644 --- a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs +++ b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs @@ -222,6 +222,7 @@ impl<'a, 'tcx, F: Fn(Ty<'tcx>) -> bool> MoveDataBuilder<'a, 'tcx, F> { _ => bug!("Unexpected type {:#?}", place_ty.is_array()), }, MoveSubPath::Downcast(_) => (), + MoveSubPath::UnwrapUnsafeBinder => (), }; move_elem diff --git a/compiler/rustc_mir_dataflow/src/move_paths/mod.rs b/compiler/rustc_mir_dataflow/src/move_paths/mod.rs index 280702114125..6faef3e974a0 100644 --- a/compiler/rustc_mir_dataflow/src/move_paths/mod.rs +++ b/compiler/rustc_mir_dataflow/src/move_paths/mod.rs @@ -396,6 +396,7 @@ pub enum MoveSubPath { Field(FieldIdx), ConstantIndex(u64), Downcast(VariantIdx), + UnwrapUnsafeBinder, } #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -416,10 +417,12 @@ impl MoveSubPath { MoveSubPath::ConstantIndex(offset) } ProjectionKind::Downcast(_, idx) => MoveSubPath::Downcast(idx), + ProjectionKind::UnwrapUnsafeBinder(_) => MoveSubPath::UnwrapUnsafeBinder, - // these should be the same move path as their parent - // they're fine to skip because they cannot have sibling move paths - ProjectionKind::OpaqueCast(_) | ProjectionKind::UnwrapUnsafeBinder(_) => { + // this should be the same move path as its parent + // its fine to skip because it cannot have sibling move paths + // and it is not a user visible path + ProjectionKind::OpaqueCast(_) => { return MoveSubPathResult::Skip; }