From 086c2d0b134ee3dcc330ab4bde64e4af80a55aeb Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Wed, 18 Jul 2018 21:03:07 +0100 Subject: [PATCH] Fix #52416 - ice for move errors in unsafe blocks --- src/librustc_mir/borrow_check/move_errors.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/librustc_mir/borrow_check/move_errors.rs b/src/librustc_mir/borrow_check/move_errors.rs index 0b49260f88a4..b7ba5c855b99 100644 --- a/src/librustc_mir/borrow_check/move_errors.rs +++ b/src/librustc_mir/borrow_check/move_errors.rs @@ -96,19 +96,19 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> { .map(|stmt| &stmt.kind) { let local_decl = &self.mir.local_decls[*local]; + // opt_match_place is the + // match_span is the span of the expression being matched on + // match *x.y { ... } match_place is Some(*x.y) + // ^^^^ match_span is the span of *x.y + // + // opt_match_place is None for let [mut] x = ... statements, + // whether or not the right-hand side is a place expression if let Some(ClearCrossCrate::Set(BindingForm::Var(VarBindingForm { opt_match_place: Some((ref opt_match_place, match_span)), binding_mode: _, opt_ty_info: _, }))) = local_decl.is_user_variable { - // opt_match_place is the - // match_span is the span of the expression being matched on - // match *x.y { ... } match_place is Some(*x.y) - // ^^^^ match_span is the span of *x.y - // opt_match_place is None for let [mut] x = ... statements, - // whether or not the right-hand side is a place expression - // HACK use scopes to determine if this assignment is // the initialization of a variable. // FIXME(matthewjasper) This would probably be more @@ -127,8 +127,8 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> { opt_match_place, match_span, ); + return; } - return; } } grouped_errors.push(GroupedMoveError::OtherIllegalMove {