@@ -1034,7 +1034,11 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
1034
1034
1035
1035
self . eq_types ( self_ty, impl_self_ty, locations, category) ?;
1036
1036
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
+ ) ;
1038
1042
}
1039
1043
1040
1044
// Prove the predicates coming along with `def_id`.
@@ -1072,11 +1076,9 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
1072
1076
/// particularly necessary -- we'll do it lazilly as we process
1073
1077
/// the value anyway -- but in some specific cases it is useful to
1074
1078
/// 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 > ,
1080
1082
{
1081
1083
if let Some ( borrowck_context) = & self . borrowck_context {
1082
1084
self . tcx ( ) . fold_regions ( & value, & mut false , |r, _debruijn| {
@@ -1212,20 +1214,22 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
1212
1214
// though.
1213
1215
let category = match * place {
1214
1216
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
+ } ,
1219
1222
..
1220
- } ) = self . borrowck_context {
1223
+ } ) = self . borrowck_context
1224
+ {
1221
1225
if tcx. is_static ( * def_id) . is_some ( ) {
1222
1226
ConstraintCategory :: UseAsStatic
1223
1227
} else {
1224
1228
ConstraintCategory :: UseAsConst
1225
1229
}
1226
1230
} else {
1227
1231
ConstraintCategory :: Return
1228
- }
1232
+ } ,
1229
1233
Place :: Local ( l) if !mir. local_decls [ l] . is_user_variable . is_some ( ) => {
1230
1234
ConstraintCategory :: Boring
1231
1235
}
@@ -1512,12 +1516,14 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
1512
1516
let category = match * dest {
1513
1517
Place :: Local ( RETURN_PLACE ) => {
1514
1518
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
+ } ,
1519
1524
..
1520
- } ) = self . borrowck_context {
1525
+ } ) = self . borrowck_context
1526
+ {
1521
1527
if tcx. is_static ( * def_id) . is_some ( ) {
1522
1528
ConstraintCategory :: UseAsStatic
1523
1529
} else {
@@ -1526,7 +1532,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
1526
1532
} else {
1527
1533
ConstraintCategory :: Return
1528
1534
}
1529
- } ,
1535
+ }
1530
1536
Place :: Local ( l) if !mir. local_decls [ l] . is_user_variable . is_some ( ) => {
1531
1537
ConstraintCategory :: Boring
1532
1538
}
@@ -1584,12 +1590,9 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
1584
1590
} else {
1585
1591
ConstraintCategory :: Boring
1586
1592
} ;
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
+ {
1593
1596
span_mirbug ! (
1594
1597
self ,
1595
1598
term,
0 commit comments