about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2017-08-11 09:25:44 +0200
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2017-08-11 09:25:44 +0200
commit2e3eaca0fab10bc7495dd04652462071a82dfd31 (patch)
tree117a74a9f4df7135add01afd6d05ae68d39fc6ee /src
parent54db165f8e7a8cd37414039e8ed76ae115f5563e (diff)
downloadrust-2e3eaca0fab10bc7495dd04652462071a82dfd31.tar.gz
rust-2e3eaca0fab10bc7495dd04652462071a82dfd31.zip
Please tidy
Diffstat (limited to 'src')
-rw-r--r--src/librustc/middle/region.rs4
-rw-r--r--src/librustc/mir/mod.rs4
-rw-r--r--src/librustc_typeck/check/generator_interior.rs6
3 files changed, 11 insertions, 3 deletions
diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs
index 1f75d09c317..9d28e2f496d 100644
--- a/src/librustc/middle/region.rs
+++ b/src/librustc/middle/region.rs
@@ -1213,7 +1213,9 @@ impl<'a, 'tcx> Visitor<'tcx> for YieldFinder<'a> {
 impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
     /// Checks whether the given code extent contains a `yield`. If so,
     /// returns `Some(span)` with the span of a yield we found.
-    pub fn yield_in_extent(self, extent: CodeExtent, cache: &mut FxHashMap<NodeId, Option<Span>>) -> Option<Span> {
+    pub fn yield_in_extent(self,
+                          extent: CodeExtent,
+                          cache: &mut FxHashMap<NodeId, Option<Span>>) -> Option<Span> {
         let mut finder = YieldFinder {
             cache,
             result: None,
diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs
index 0d3629a8e5f..6484572d224 100644
--- a/src/librustc/mir/mod.rs
+++ b/src/librustc/mir/mod.rs
@@ -1893,7 +1893,9 @@ impl<'tcx> TypeFoldable<'tcx> for Rvalue<'tcx> {
                     AggregateKind::Closure(id, substs) =>
                         AggregateKind::Closure(id, substs.fold_with(folder)),
                     AggregateKind::Generator(id, substs, interior) =>
-                        AggregateKind::Generator(id, substs.fold_with(folder), interior.fold_with(folder)),
+                        AggregateKind::Generator(id,
+                                                 substs.fold_with(folder),
+                                                 interior.fold_with(folder)),
                 };
                 Aggregate(kind, fields.fold_with(folder))
             }
diff --git a/src/librustc_typeck/check/generator_interior.rs b/src/librustc_typeck/check/generator_interior.rs
index a5440e6d992..5bfcf77cda8 100644
--- a/src/librustc_typeck/check/generator_interior.rs
+++ b/src/librustc_typeck/check/generator_interior.rs
@@ -32,7 +32,11 @@ impl<'a, 'gcx, 'tcx> InteriorVisitor<'a, 'gcx, 'tcx> {
     fn record(&mut self, ty: Ty<'tcx>, scope: Option<CodeExtent>, expr: Option<&'tcx Expr>) {
         use syntax_pos::DUMMY_SP;
 
-        if scope.map(|s| self.fcx.tcx.yield_in_extent(s, &mut self.cache).is_some()).unwrap_or(true) {
+        let live_across_yield = scope.map(|s| {
+            self.fcx.tcx.yield_in_extent(s, &mut self.cache).is_some()
+        }).unwrap_or(true);
+
+        if live_across_yield {
             if log_enabled!(log::LogLevel::Debug) {
                 if let Some(s) = scope {
                     let span = s.span(&self.fcx.tcx.hir).unwrap_or(DUMMY_SP);