@@ -345,13 +345,13 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
345345 fn make_final_bounds (
346346 & self ,
347347 ty_to_bounds : FxHashMap < Type , FxHashSet < GenericBound > > ,
348- ty_to_fn : FxHashMap < Type , ( Option < PolyTrait > , Option < Type > ) > ,
348+ ty_to_fn : FxHashMap < Type , ( PolyTrait , Option < Type > ) > ,
349349 lifetime_to_bounds : FxHashMap < Lifetime , FxHashSet < GenericBound > > ,
350350 ) -> Vec < WherePredicate > {
351351 ty_to_bounds
352352 . into_iter ( )
353353 . flat_map ( |( ty, mut bounds) | {
354- if let Some ( ( Some ( ref poly_trait) , ref output) ) = ty_to_fn. get ( & ty) {
354+ if let Some ( ( ref poly_trait, ref output) ) = ty_to_fn. get ( & ty) {
355355 let mut new_path = poly_trait. trait_ . clone ( ) ;
356356 let last_segment = new_path. segments . pop ( ) . expect ( "segments were empty" ) ;
357357
@@ -470,7 +470,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
470470 let mut lifetime_to_bounds: FxHashMap < _ , FxHashSet < _ > > = Default :: default ( ) ;
471471 let mut ty_to_traits: FxHashMap < Type , FxHashSet < Path > > = Default :: default ( ) ;
472472
473- let mut ty_to_fn: FxHashMap < Type , ( Option < PolyTrait > , Option < Type > ) > = Default :: default ( ) ;
473+ let mut ty_to_fn: FxHashMap < Type , ( PolyTrait , Option < Type > ) > = Default :: default ( ) ;
474474
475475 for p in clean_where_predicates {
476476 let ( orig_p, p) = ( p, p. clean ( self . cx ) ) ;
@@ -534,8 +534,8 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
534534 if is_fn {
535535 ty_to_fn
536536 . entry ( ty. clone ( ) )
537- . and_modify ( |e| * e = ( Some ( poly_trait. clone ( ) ) , e. 1 . clone ( ) ) )
538- . or_insert ( ( ( Some ( poly_trait. clone ( ) ) ) , None ) ) ;
537+ . and_modify ( |e| * e = ( poly_trait. clone ( ) , e. 1 . clone ( ) ) )
538+ . or_insert ( ( ( poly_trait. clone ( ) ) , None ) ) ;
539539
540540 ty_to_bounds. entry ( ty. clone ( ) ) . or_default ( ) ;
541541 } else {
@@ -558,7 +558,13 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
558558 . and_modify ( |e| {
559559 * e = ( e. 0 . clone ( ) , Some ( rhs. ty ( ) . unwrap ( ) . clone ( ) ) )
560560 } )
561- . or_insert ( ( None , Some ( rhs. ty ( ) . unwrap ( ) . clone ( ) ) ) ) ;
561+ . or_insert ( (
562+ PolyTrait {
563+ trait_ : trait_. clone ( ) ,
564+ generic_params : Vec :: new ( ) ,
565+ } ,
566+ Some ( rhs. ty ( ) . unwrap ( ) . clone ( ) ) ,
567+ ) ) ;
562568 continue ;
563569 }
564570
0 commit comments