@@ -596,9 +596,24 @@ pub fn trait_ref_is_local_or_fundamental<'tcx>(
596596 trait_ref. def_id . krate == LOCAL_CRATE || tcx. has_attr ( trait_ref. def_id , sym:: fundamental)
597597}
598598
599+ #[ derive( Debug , Copy , Clone ) ]
600+ pub enum IsFirstInputType {
601+ No ,
602+ Yes ,
603+ }
604+
605+ impl From < bool > for IsFirstInputType {
606+ fn from ( b : bool ) -> IsFirstInputType {
607+ match b {
608+ false => IsFirstInputType :: No ,
609+ true => IsFirstInputType :: Yes ,
610+ }
611+ }
612+ }
613+
599614#[ derive( Debug ) ]
600615pub enum OrphanCheckErr < ' tcx > {
601- NonLocalInputType ( Vec < ( Ty < ' tcx > , bool /* Is this the first input type? */ ) > ) ,
616+ NonLocalInputType ( Vec < ( Ty < ' tcx > , IsFirstInputType ) > ) ,
602617 UncoveredTy ( Ty < ' tcx > , Option < Ty < ' tcx > > ) ,
603618}
604619
@@ -749,7 +764,7 @@ struct OrphanChecker<'tcx, F> {
749764 /// Ignore orphan check failures and exclusively search for the first
750765 /// local type.
751766 search_first_local_ty : bool ,
752- non_local_tys : Vec < ( Ty < ' tcx > , bool ) > ,
767+ non_local_tys : Vec < ( Ty < ' tcx > , IsFirstInputType ) > ,
753768}
754769
755770impl < ' tcx , F , E > OrphanChecker < ' tcx , F >
@@ -767,7 +782,7 @@ where
767782 }
768783
769784 fn found_non_local_ty ( & mut self , t : Ty < ' tcx > ) -> ControlFlow < OrphanCheckEarlyExit < ' tcx , E > > {
770- self . non_local_tys . push ( ( t, self . in_self_ty ) ) ;
785+ self . non_local_tys . push ( ( t, self . in_self_ty . into ( ) ) ) ;
771786 ControlFlow :: Continue ( ( ) )
772787 }
773788
0 commit comments