Skip to content

Commit bce7f71

Browse files
committed
make move unwrap_binder! a move subpath
1 parent b151a5e commit bce7f71

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

compiler/rustc_mir_dataflow/src/move_paths/builder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ impl<'a, 'tcx, F: Fn(Ty<'tcx>) -> bool> MoveDataBuilder<'a, 'tcx, F> {
222222
_ => bug!("Unexpected type {:#?}", place_ty.is_array()),
223223
},
224224
MoveSubPath::Downcast(_) => (),
225+
MoveSubPath::UnwrapUnsafeBinder => (),
225226
};
226227

227228
move_elem

compiler/rustc_mir_dataflow/src/move_paths/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ pub enum MoveSubPath {
396396
Field(FieldIdx),
397397
ConstantIndex(u64),
398398
Downcast(VariantIdx),
399+
UnwrapUnsafeBinder,
399400
}
400401

401402
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
@@ -416,10 +417,12 @@ impl MoveSubPath {
416417
MoveSubPath::ConstantIndex(offset)
417418
}
418419
ProjectionKind::Downcast(_, idx) => MoveSubPath::Downcast(idx),
420+
ProjectionKind::UnwrapUnsafeBinder(_) => MoveSubPath::UnwrapUnsafeBinder,
419421

420-
// these should be the same move path as their parent
421-
// they're fine to skip because they cannot have sibling move paths
422-
ProjectionKind::OpaqueCast(_) | ProjectionKind::UnwrapUnsafeBinder(_) => {
422+
// this should be the same move path as its parent
423+
// its fine to skip because it cannot have sibling move paths
424+
// and it is not a user visible path
425+
ProjectionKind::OpaqueCast(_) => {
423426
return MoveSubPathResult::Skip;
424427
}
425428

0 commit comments

Comments
 (0)