@@ -348,13 +348,13 @@ where
348
348
fn make_final_bounds (
349
349
& self ,
350
350
ty_to_bounds : FxHashMap < Type , FxHashSet < GenericBound > > ,
351
- ty_to_fn : FxHashMap < Type , ( Option < PolyTrait > , Option < Type > ) > ,
351
+ ty_to_fn : FxHashMap < Type , ( PolyTrait , Option < Type > ) > ,
352
352
lifetime_to_bounds : FxHashMap < Lifetime , FxHashSet < GenericBound > > ,
353
353
) -> Vec < WherePredicate > {
354
354
ty_to_bounds
355
355
. into_iter ( )
356
356
. flat_map ( |( ty, mut bounds) | {
357
- if let Some ( ( Some ( ref poly_trait) , ref output) ) = ty_to_fn. get ( & ty) {
357
+ if let Some ( ( ref poly_trait, ref output) ) = ty_to_fn. get ( & ty) {
358
358
let mut new_path = poly_trait. trait_ . clone ( ) ;
359
359
let last_segment = new_path. segments . pop ( ) . expect ( "segments were empty" ) ;
360
360
@@ -473,7 +473,7 @@ where
473
473
let mut lifetime_to_bounds: FxHashMap < _ , FxHashSet < _ > > = Default :: default ( ) ;
474
474
let mut ty_to_traits: FxHashMap < Type , FxHashSet < Path > > = Default :: default ( ) ;
475
475
476
- let mut ty_to_fn: FxHashMap < Type , ( Option < PolyTrait > , Option < Type > ) > = Default :: default ( ) ;
476
+ let mut ty_to_fn: FxHashMap < Type , ( PolyTrait , Option < Type > ) > = Default :: default ( ) ;
477
477
478
478
for p in clean_where_predicates {
479
479
let ( orig_p, p) = ( p, p. clean ( self . cx ) ) ;
@@ -537,8 +537,8 @@ where
537
537
if is_fn {
538
538
ty_to_fn
539
539
. entry ( ty. clone ( ) )
540
- . and_modify ( |e| * e = ( Some ( poly_trait. clone ( ) ) , e. 1 . clone ( ) ) )
541
- . or_insert ( ( ( Some ( poly_trait. clone ( ) ) ) , None ) ) ;
540
+ . and_modify ( |e| * e = ( poly_trait. clone ( ) , e. 1 . clone ( ) ) )
541
+ . or_insert ( ( ( poly_trait. clone ( ) ) , None ) ) ;
542
542
543
543
ty_to_bounds. entry ( ty. clone ( ) ) . or_default ( ) ;
544
544
} else {
@@ -561,7 +561,13 @@ where
561
561
. and_modify ( |e| {
562
562
* e = ( e. 0 . clone ( ) , Some ( rhs. ty ( ) . unwrap ( ) . clone ( ) ) )
563
563
} )
564
- . or_insert ( ( None , Some ( rhs. ty ( ) . unwrap ( ) . clone ( ) ) ) ) ;
564
+ . or_insert ( (
565
+ PolyTrait {
566
+ trait_ : trait_. clone ( ) ,
567
+ generic_params : Vec :: new ( ) ,
568
+ } ,
569
+ Some ( rhs. ty ( ) . unwrap ( ) . clone ( ) ) ,
570
+ ) ) ;
565
571
continue ;
566
572
}
567
573
0 commit comments