Skip to content

Commit 086c2d0

Browse files
committed
Fix #52416 - ice for move errors in unsafe blocks
1 parent 1241274 commit 086c2d0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/librustc_mir/borrow_check/move_errors.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,19 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
9696
.map(|stmt| &stmt.kind)
9797
{
9898
let local_decl = &self.mir.local_decls[*local];
99+
// opt_match_place is the
100+
// match_span is the span of the expression being matched on
101+
// match *x.y { ... } match_place is Some(*x.y)
102+
// ^^^^ match_span is the span of *x.y
103+
//
104+
// opt_match_place is None for let [mut] x = ... statements,
105+
// whether or not the right-hand side is a place expression
99106
if let Some(ClearCrossCrate::Set(BindingForm::Var(VarBindingForm {
100107
opt_match_place: Some((ref opt_match_place, match_span)),
101108
binding_mode: _,
102109
opt_ty_info: _,
103110
}))) = local_decl.is_user_variable
104111
{
105-
// opt_match_place is the
106-
// match_span is the span of the expression being matched on
107-
// match *x.y { ... } match_place is Some(*x.y)
108-
// ^^^^ match_span is the span of *x.y
109-
// opt_match_place is None for let [mut] x = ... statements,
110-
// whether or not the right-hand side is a place expression
111-
112112
// HACK use scopes to determine if this assignment is
113113
// the initialization of a variable.
114114
// FIXME(matthewjasper) This would probably be more
@@ -127,8 +127,8 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
127127
opt_match_place,
128128
match_span,
129129
);
130+
return;
130131
}
131-
return;
132132
}
133133
}
134134
grouped_errors.push(GroupedMoveError::OtherIllegalMove {

0 commit comments

Comments
 (0)