about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2018-07-18 21:03:07 +0100
committerMatthew Jasper <mjjasper1@gmail.com>2018-07-21 18:40:46 +0100
commit086c2d0b134ee3dcc330ab4bde64e4af80a55aeb (patch)
tree553e2c4886db6b5979b29022b78f952007784e38
parent12412749ab209447611c6d071e187d787c6feeb2 (diff)
downloadrust-086c2d0b134ee3dcc330ab4bde64e4af80a55aeb.tar.gz
rust-086c2d0b134ee3dcc330ab4bde64e4af80a55aeb.zip
Fix #52416 - ice for move errors in unsafe blocks
-rw-r--r--src/librustc_mir/borrow_check/move_errors.rs16
1 files 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 0b49260f88a..b7ba5c855b9 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 {