Skip to content

Commit 66345d9

Browse files
rustfmt
1 parent 323f079 commit 66345d9

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

compiler/rustc_typeck/src/check/generator_interior.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
88
use rustc_hir as hir;
99
use rustc_hir::def::{CtorKind, DefKind, Res};
1010
use rustc_hir::def_id::DefId;
11-
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
12-
use rustc_hir::{Expr, ExprKind, Pat, PatKind, Arm, Guard, HirId};
1311
use rustc_hir::hir_id::HirIdSet;
12+
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
13+
use rustc_hir::{Arm, Expr, ExprKind, Guard, HirId, Pat, PatKind};
1414
use rustc_middle::middle::region::{self, YieldData};
1515
use rustc_middle::ty::{self, Ty};
1616
use rustc_span::Span;
@@ -64,7 +64,9 @@ impl<'a, 'tcx> InteriorVisitor<'a, 'tcx> {
6464
yield_data.expr_and_pat_count, self.expr_count, source_span
6565
);
6666

67-
if guard_borrowing_from_pattern || yield_data.expr_and_pat_count >= self.expr_count {
67+
if guard_borrowing_from_pattern
68+
|| yield_data.expr_and_pat_count >= self.expr_count
69+
{
6870
Some(yield_data)
6971
} else {
7072
None
@@ -239,7 +241,10 @@ impl<'a, 'tcx> Visitor<'tcx> for InteriorVisitor<'a, 'tcx> {
239241
let mut scope_var_ids =
240242
self.nested_scope_of_guards.pop().expect("should have pushed at least one earlier");
241243
for var_id in scope_var_ids.drain(..) {
242-
assert!(self.current_scope_of_guards.remove(&var_id), "variable should be placed in scope earlier");
244+
assert!(
245+
self.current_scope_of_guards.remove(&var_id),
246+
"variable should be placed in scope earlier"
247+
);
243248
}
244249
self.arm_has_guard = false;
245250
}
@@ -289,7 +294,7 @@ impl<'a, 'tcx> Visitor<'tcx> for InteriorVisitor<'a, 'tcx> {
289294
}
290295
}
291296
_ => intravisit::walk_expr(self, expr),
292-
}
297+
},
293298
ExprKind::Path(qpath) => {
294299
intravisit::walk_expr(self, expr);
295300
let res = self.fcx.typeck_results.borrow().qpath_res(qpath, expr.hir_id);

src/test/ui/generator/yielding-in-match-guards.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ async fn g() {
2626
}
2727
}
2828

29-
fn main() {}
29+
fn main() {}

0 commit comments

Comments
 (0)