Skip to content

Commit bd10ef7

Browse files
committed
rustc_typeck/check/closure: rustfmt
1 parent 16362c7 commit bd10ef7

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

src/librustc_typeck/check/closure.rs

+27-24
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
4242
) -> Ty<'tcx> {
4343
debug!(
4444
"check_expr_closure(expr={:?},expected={:?})",
45-
expr,
46-
expected
45+
expr, expected
4746
);
4847

4948
// It's always helpful for inference if we know the kind of
@@ -68,8 +67,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
6867
) -> Ty<'tcx> {
6968
debug!(
7069
"check_closure(opt_kind={:?}, expected_sig={:?})",
71-
opt_kind,
72-
expected_sig
70+
opt_kind, expected_sig
7371
);
7472

7573
let expr_def_id = self.tcx.hir.local_def_id(expr.id);
@@ -109,19 +107,22 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
109107
let closure_type = self.tcx.mk_closure(expr_def_id, substs);
110108

111109
if let Some(GeneratorTypes { yield_ty, interior }) = generator_types {
112-
self.demand_eqtype(expr.span,
113-
yield_ty,
114-
substs.generator_yield_ty(expr_def_id, self.tcx));
115-
self.demand_eqtype(expr.span,
116-
liberated_sig.output(),
117-
substs.generator_return_ty(expr_def_id, self.tcx));
110+
self.demand_eqtype(
111+
expr.span,
112+
yield_ty,
113+
substs.generator_yield_ty(expr_def_id, self.tcx),
114+
);
115+
self.demand_eqtype(
116+
expr.span,
117+
liberated_sig.output(),
118+
substs.generator_return_ty(expr_def_id, self.tcx),
119+
);
118120
return self.tcx.mk_generator(expr_def_id, substs, interior);
119121
}
120122

121123
debug!(
122124
"check_closure: expr.id={:?} closure_type={:?}",
123-
expr.id,
124-
closure_type
125+
expr.id, closure_type
125126
);
126127

127128
// Tuple up the arguments and insert the resulting function type into
@@ -138,20 +139,22 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
138139

139140
debug!(
140141
"check_closure: expr_def_id={:?}, sig={:?}, opt_kind={:?}",
141-
expr_def_id,
142-
sig,
143-
opt_kind
142+
expr_def_id, sig, opt_kind
144143
);
145144

146145
let sig_fn_ptr_ty = self.tcx.mk_fn_ptr(sig);
147-
self.demand_eqtype(expr.span,
148-
sig_fn_ptr_ty,
149-
substs.closure_sig_ty(expr_def_id, self.tcx));
146+
self.demand_eqtype(
147+
expr.span,
148+
sig_fn_ptr_ty,
149+
substs.closure_sig_ty(expr_def_id, self.tcx),
150+
);
150151

151152
if let Some(kind) = opt_kind {
152-
self.demand_eqtype(expr.span,
153-
kind.to_ty(self.tcx),
154-
substs.closure_kind_ty(expr_def_id, self.tcx));
153+
self.demand_eqtype(
154+
expr.span,
155+
kind.to_ty(self.tcx),
156+
substs.closure_kind_ty(expr_def_id, self.tcx),
157+
);
155158
}
156159

157160
closure_type
@@ -314,8 +317,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
314317
let self_ty = self.shallow_resolve(trait_ref.self_ty());
315318
debug!(
316319
"self_type_matches_expected_vid(trait_ref={:?}, self_ty={:?})",
317-
trait_ref,
318-
self_ty
320+
trait_ref, self_ty
319321
);
320322
match self_ty.sty {
321323
ty::TyInfer(ty::TyVar(v)) if expected_vid == v => Some(trait_ref),
@@ -564,7 +566,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
564566
body: &hir::Body,
565567
bound_sig: ty::PolyFnSig<'tcx>,
566568
) -> ClosureSignatures<'tcx> {
567-
let liberated_sig = self.tcx().liberate_late_bound_regions(expr_def_id, &bound_sig);
569+
let liberated_sig = self.tcx()
570+
.liberate_late_bound_regions(expr_def_id, &bound_sig);
568571
let liberated_sig = self.inh.normalize_associated_types_in(
569572
body.value.span,
570573
body.value.id,

0 commit comments

Comments
 (0)