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; }