Skip to content

Commit 4394c83

Browse files
committed
type_check/mod.rs: rustfmt
1 parent 1371cd2 commit 4394c83

File tree

1 file changed

+27
-24
lines changed
  • src/librustc_mir/borrow_check/nll/type_check

1 file changed

+27
-24
lines changed

src/librustc_mir/borrow_check/nll/type_check/mod.rs

+27-24
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,11 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
10341034

10351035
self.eq_types(self_ty, impl_self_ty, locations, category)?;
10361036

1037-
self.prove_predicate(ty::Predicate::WellFormed(impl_self_ty), locations, category);
1037+
self.prove_predicate(
1038+
ty::Predicate::WellFormed(impl_self_ty),
1039+
locations,
1040+
category,
1041+
);
10381042
}
10391043

10401044
// Prove the predicates coming along with `def_id`.
@@ -1072,11 +1076,9 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
10721076
/// particularly necessary -- we'll do it lazilly as we process
10731077
/// the value anyway -- but in some specific cases it is useful to
10741078
/// normalize so we can suppress duplicate error messages.
1075-
fn fold_to_region_vid<T>(
1076-
&self,
1077-
value: T
1078-
) -> T
1079-
where T: TypeFoldable<'tcx>
1079+
fn fold_to_region_vid<T>(&self, value: T) -> T
1080+
where
1081+
T: TypeFoldable<'tcx>,
10801082
{
10811083
if let Some(borrowck_context) = &self.borrowck_context {
10821084
self.tcx().fold_regions(&value, &mut false, |r, _debruijn| {
@@ -1212,20 +1214,22 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
12121214
// though.
12131215
let category = match *place {
12141216
Place::Local(RETURN_PLACE) => if let Some(BorrowCheckContext {
1215-
universal_regions: UniversalRegions {
1216-
defining_ty: DefiningTy::Const(def_id, _),
1217-
..
1218-
},
1217+
universal_regions:
1218+
UniversalRegions {
1219+
defining_ty: DefiningTy::Const(def_id, _),
1220+
..
1221+
},
12191222
..
1220-
}) = self.borrowck_context {
1223+
}) = self.borrowck_context
1224+
{
12211225
if tcx.is_static(*def_id).is_some() {
12221226
ConstraintCategory::UseAsStatic
12231227
} else {
12241228
ConstraintCategory::UseAsConst
12251229
}
12261230
} else {
12271231
ConstraintCategory::Return
1228-
}
1232+
},
12291233
Place::Local(l) if !mir.local_decls[l].is_user_variable.is_some() => {
12301234
ConstraintCategory::Boring
12311235
}
@@ -1512,12 +1516,14 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
15121516
let category = match *dest {
15131517
Place::Local(RETURN_PLACE) => {
15141518
if let Some(BorrowCheckContext {
1515-
universal_regions: UniversalRegions {
1516-
defining_ty: DefiningTy::Const(def_id, _),
1517-
..
1518-
},
1519+
universal_regions:
1520+
UniversalRegions {
1521+
defining_ty: DefiningTy::Const(def_id, _),
1522+
..
1523+
},
15191524
..
1520-
}) = self.borrowck_context {
1525+
}) = self.borrowck_context
1526+
{
15211527
if tcx.is_static(*def_id).is_some() {
15221528
ConstraintCategory::UseAsStatic
15231529
} else {
@@ -1526,7 +1532,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
15261532
} else {
15271533
ConstraintCategory::Return
15281534
}
1529-
},
1535+
}
15301536
Place::Local(l) if !mir.local_decls[l].is_user_variable.is_some() => {
15311537
ConstraintCategory::Boring
15321538
}
@@ -1584,12 +1590,9 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
15841590
} else {
15851591
ConstraintCategory::Boring
15861592
};
1587-
if let Err(terr) = self.sub_types(
1588-
op_arg_ty,
1589-
fn_arg,
1590-
term_location.to_locations(),
1591-
category,
1592-
) {
1593+
if let Err(terr) =
1594+
self.sub_types(op_arg_ty, fn_arg, term_location.to_locations(), category)
1595+
{
15931596
span_mirbug!(
15941597
self,
15951598
term,

0 commit comments

Comments
 (0)