@@ -598,9 +598,24 @@ pub fn trait_ref_is_local_or_fundamental<'tcx>(
598598 trait_ref. def_id . krate == LOCAL_CRATE || tcx. has_attr ( trait_ref. def_id , sym:: fundamental)
599599}
600600
601+ #[ derive( Debug , Copy , Clone ) ]
602+ pub enum IsFirstInputType {
603+ No ,
604+ Yes ,
605+ }
606+
607+ impl From < bool > for IsFirstInputType {
608+ fn from ( b : bool ) -> IsFirstInputType {
609+ match b {
610+ false => IsFirstInputType :: No ,
611+ true => IsFirstInputType :: Yes ,
612+ }
613+ }
614+ }
615+
601616#[ derive( Debug ) ]
602617pub enum OrphanCheckErr < ' tcx > {
603- NonLocalInputType ( Vec < ( Ty < ' tcx > , bool /* Is this the first input type? */ ) > ) ,
618+ NonLocalInputType ( Vec < ( Ty < ' tcx > , IsFirstInputType ) > ) ,
604619 UncoveredTy ( Ty < ' tcx > , Option < Ty < ' tcx > > ) ,
605620}
606621
@@ -751,7 +766,7 @@ struct OrphanChecker<'tcx, F> {
751766 /// Ignore orphan check failures and exclusively search for the first
752767 /// local type.
753768 search_first_local_ty : bool ,
754- non_local_tys : Vec < ( Ty < ' tcx > , bool ) > ,
769+ non_local_tys : Vec < ( Ty < ' tcx > , IsFirstInputType ) > ,
755770}
756771
757772impl < ' tcx , F , E > OrphanChecker < ' tcx , F >
@@ -769,7 +784,7 @@ where
769784 }
770785
771786 fn found_non_local_ty ( & mut self , t : Ty < ' tcx > ) -> ControlFlow < OrphanCheckEarlyExit < ' tcx , E > > {
772- self . non_local_tys . push ( ( t, self . in_self_ty ) ) ;
787+ self . non_local_tys . push ( ( t, self . in_self_ty . into ( ) ) ) ;
773788 ControlFlow :: Continue ( ( ) )
774789 }
775790
0 commit comments