@@ -316,7 +316,7 @@ impl<'a> TyLoweringContext<'a> {
316
316
// place even if we encounter more opaque types while
317
317
// lowering the bounds
318
318
let idx = opaque_type_data. borrow_mut ( ) . alloc ( ImplTrait {
319
- bounds : crate :: make_single_type_binders ( Vec :: new ( ) ) ,
319
+ bounds : crate :: make_single_type_binders ( Vec :: default ( ) ) ,
320
320
} ) ;
321
321
// We don't want to lower the bounds inside the binders
322
322
// we're currently in, because they don't end up inside
@@ -1007,11 +1007,11 @@ impl<'a> TyLoweringContext<'a> {
1007
1007
self . substs_from_path_segment ( segment, Some ( resolved. into ( ) ) , false , explicit_self_ty)
1008
1008
}
1009
1009
1010
- pub ( crate ) fn lower_where_predicate (
1011
- & self ,
1012
- where_predicate : & WherePredicate ,
1010
+ pub ( crate ) fn lower_where_predicate < ' b > (
1011
+ & ' b self ,
1012
+ where_predicate : & ' b WherePredicate ,
1013
1013
ignore_bindings : bool ,
1014
- ) -> impl Iterator < Item = QuantifiedWhereClause > {
1014
+ ) -> impl Iterator < Item = QuantifiedWhereClause > + ' b {
1015
1015
match where_predicate {
1016
1016
WherePredicate :: ForLifetime { target, bound, .. }
1017
1017
| WherePredicate :: TypeBound { target, bound } => {
@@ -1034,18 +1034,16 @@ impl<'a> TyLoweringContext<'a> {
1034
1034
. intern ( Interner )
1035
1035
}
1036
1036
} ;
1037
- self . lower_type_bound ( bound, self_ty, ignore_bindings)
1038
- . collect :: < Vec < _ > > ( )
1039
- . into_iter ( )
1037
+ Either :: Left ( self . lower_type_bound ( bound, self_ty, ignore_bindings) )
1040
1038
}
1041
- WherePredicate :: Lifetime { bound, target } => {
1042
- vec ! [ crate :: wrap_empty_binders( WhereClause :: LifetimeOutlives ( LifetimeOutlives {
1039
+ WherePredicate :: Lifetime { bound, target } => Either :: Right ( iter :: once (
1040
+ crate :: wrap_empty_binders ( WhereClause :: LifetimeOutlives ( LifetimeOutlives {
1043
1041
a : self . lower_lifetime ( bound) ,
1044
1042
b : self . lower_lifetime ( target) ,
1045
- } ) ) ]
1046
- . into_iter ( )
1047
- }
1043
+ } ) ) ,
1044
+ ) ) ,
1048
1045
}
1046
+ . into_iter ( )
1049
1047
}
1050
1048
1051
1049
pub ( crate ) fn lower_type_bound (
@@ -1380,8 +1378,8 @@ impl<'a> TyLoweringContext<'a> {
1380
1378
crate :: wrap_empty_binders ( clause)
1381
1379
} ) ;
1382
1380
predicates. extend ( sized_clause) ;
1383
- predicates. shrink_to_fit ( ) ;
1384
1381
}
1382
+ predicates. shrink_to_fit ( ) ;
1385
1383
predicates
1386
1384
} ) ;
1387
1385
ImplTrait { bounds : crate :: make_single_type_binders ( predicates) }
0 commit comments