@@ -348,13 +348,13 @@ where
348348 fn make_final_bounds (
349349 & self ,
350350 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 > ) > ,
352352 lifetime_to_bounds : FxHashMap < Lifetime , FxHashSet < GenericBound > > ,
353353 ) -> Vec < WherePredicate > {
354354 ty_to_bounds
355355 . into_iter ( )
356356 . 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) {
358358 let mut new_path = poly_trait. trait_ . clone ( ) ;
359359 let last_segment = new_path. segments . pop ( ) . expect ( "segments were empty" ) ;
360360
@@ -473,7 +473,7 @@ where
473473 let mut lifetime_to_bounds: FxHashMap < _ , FxHashSet < _ > > = Default :: default ( ) ;
474474 let mut ty_to_traits: FxHashMap < Type , FxHashSet < Path > > = Default :: default ( ) ;
475475
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 ( ) ;
477477
478478 for p in clean_where_predicates {
479479 let ( orig_p, p) = ( p, p. clean ( self . cx ) ) ;
@@ -537,8 +537,8 @@ where
537537 if is_fn {
538538 ty_to_fn
539539 . 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 ) ) ;
542542
543543 ty_to_bounds. entry ( ty. clone ( ) ) . or_default ( ) ;
544544 } else {
@@ -561,7 +561,13 @@ where
561561 . and_modify ( |e| {
562562 * e = ( e. 0 . clone ( ) , Some ( rhs. ty ( ) . unwrap ( ) . clone ( ) ) )
563563 } )
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+ ) ) ;
565571 continue ;
566572 }
567573
0 commit comments