about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs44
1 files changed, 22 insertions, 22 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
index 5b61223a67f..85e3788d1e3 100644
--- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
+++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
@@ -859,28 +859,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
             })
             .sum();
 
-        /// Look for `break` expressions within any arbitrary expressions. We'll do this to infer
-        /// whether this is a case where the moved value would affect the exit of a loop, making it
-        /// unsuitable for a `.clone()` suggestion.
-        struct BreakFinder {
-            found_breaks: Vec<(hir::Destination, Span)>,
-            found_continues: Vec<(hir::Destination, Span)>,
-        }
-        impl<'hir> Visitor<'hir> for BreakFinder {
-            fn visit_expr(&mut self, ex: &'hir hir::Expr<'hir>) {
-                match ex.kind {
-                    hir::ExprKind::Break(destination, _) => {
-                        self.found_breaks.push((destination, ex.span));
-                    }
-                    hir::ExprKind::Continue(destination) => {
-                        self.found_continues.push((destination, ex.span));
-                    }
-                    _ => {}
-                }
-                hir::intravisit::walk_expr(self, ex);
-            }
-        }
-
         let sm = tcx.sess.source_map();
         if let Some(in_loop) = outer_most_loop {
             let mut finder = BreakFinder { found_breaks: vec![], found_continues: vec![] };
@@ -3943,6 +3921,28 @@ impl<'a, 'v> Visitor<'v> for ReferencedStatementsVisitor<'a> {
     }
 }
 
+/// Look for `break` expressions within any arbitrary expressions. We'll do this to infer
+/// whether this is a case where the moved value would affect the exit of a loop, making it
+/// unsuitable for a `.clone()` suggestion.
+struct BreakFinder {
+    found_breaks: Vec<(hir::Destination, Span)>,
+    found_continues: Vec<(hir::Destination, Span)>,
+}
+impl<'hir> Visitor<'hir> for BreakFinder {
+    fn visit_expr(&mut self, ex: &'hir hir::Expr<'hir>) {
+        match ex.kind {
+            hir::ExprKind::Break(destination, _) => {
+                self.found_breaks.push((destination, ex.span));
+            }
+            hir::ExprKind::Continue(destination) => {
+                self.found_continues.push((destination, ex.span));
+            }
+            _ => {}
+        }
+        hir::intravisit::walk_expr(self, ex);
+    }
+}
+
 /// Given a set of spans representing statements initializing the relevant binding, visit all the
 /// function expressions looking for branching code paths that *do not* initialize the binding.
 struct ConditionVisitor<'b> {