@@ -47,7 +47,7 @@ pub enum Conflict {
4747pub fn trait_ref_is_knowable < Infcx , I , E > (
4848 infcx : & Infcx ,
4949 trait_ref : ty:: TraitRef < I > ,
50- mut lazily_normalize_ty : impl FnMut ( I :: Ty ) -> Result < I :: Ty , E > ,
50+ mut lazily_normalize_ty : impl FnMut ( ty :: Ty < I > ) -> Result < ty :: Ty < I > , E > ,
5151) -> Result < Result < ( ) , Conflict > , E >
5252where
5353 Infcx : InferCtxtLike < Interner = I > ,
@@ -115,14 +115,14 @@ impl From<bool> for IsFirstInputType {
115115
116116#[ derive_where( Debug ; I : Interner , T : Debug ) ]
117117pub enum OrphanCheckErr < I : Interner , T > {
118- NonLocalInputType ( Vec < ( I :: Ty , IsFirstInputType ) > ) ,
118+ NonLocalInputType ( Vec < ( ty :: Ty < I > , IsFirstInputType ) > ) ,
119119 UncoveredTyParams ( UncoveredTyParams < I , T > ) ,
120120}
121121
122122#[ derive_where( Debug ; I : Interner , T : Debug ) ]
123123pub struct UncoveredTyParams < I : Interner , T > {
124124 pub uncovered : T ,
125- pub local_ty : Option < I :: Ty > ,
125+ pub local_ty : Option < ty :: Ty < I > > ,
126126}
127127
128128/// Checks whether a trait-ref is potentially implementable by a crate.
@@ -222,8 +222,8 @@ pub fn orphan_check_trait_ref<Infcx, I, E: Debug>(
222222 infcx : & Infcx ,
223223 trait_ref : ty:: TraitRef < I > ,
224224 in_crate : InCrate ,
225- lazily_normalize_ty : impl FnMut ( I :: Ty ) -> Result < I :: Ty , E > ,
226- ) -> Result < Result < ( ) , OrphanCheckErr < I , I :: Ty > > , E >
225+ lazily_normalize_ty : impl FnMut ( ty :: Ty < I > ) -> Result < ty :: Ty < I > , E > ,
226+ ) -> Result < Result < ( ) , OrphanCheckErr < I , ty :: Ty < I > > > , E >
227227where
228228 Infcx : InferCtxtLike < Interner = I > ,
229229 I : Interner ,
@@ -262,14 +262,14 @@ struct OrphanChecker<'a, Infcx, I: Interner, F> {
262262 lazily_normalize_ty : F ,
263263 /// Ignore orphan check failures and exclusively search for the first local type.
264264 search_first_local_ty : bool ,
265- non_local_tys : Vec < ( I :: Ty , IsFirstInputType ) > ,
265+ non_local_tys : Vec < ( ty :: Ty < I > , IsFirstInputType ) > ,
266266}
267267
268268impl < ' a , Infcx , I , F , E > OrphanChecker < ' a , Infcx , I , F >
269269where
270270 Infcx : InferCtxtLike < Interner = I > ,
271271 I : Interner ,
272- F : FnOnce ( I :: Ty ) -> Result < I :: Ty , E > ,
272+ F : FnOnce ( ty :: Ty < I > ) -> Result < ty :: Ty < I > , E > ,
273273{
274274 fn new ( infcx : & ' a Infcx , in_crate : InCrate , lazily_normalize_ty : F ) -> Self {
275275 OrphanChecker {
@@ -282,12 +282,15 @@ where
282282 }
283283 }
284284
285- fn found_non_local_ty ( & mut self , t : I :: Ty ) -> ControlFlow < OrphanCheckEarlyExit < I , E > > {
285+ fn found_non_local_ty ( & mut self , t : ty :: Ty < I > ) -> ControlFlow < OrphanCheckEarlyExit < I , E > > {
286286 self . non_local_tys . push ( ( t, self . in_self_ty . into ( ) ) ) ;
287287 ControlFlow :: Continue ( ( ) )
288288 }
289289
290- fn found_uncovered_ty_param ( & mut self , ty : I :: Ty ) -> ControlFlow < OrphanCheckEarlyExit < I , E > > {
290+ fn found_uncovered_ty_param (
291+ & mut self ,
292+ ty : ty:: Ty < I > ,
293+ ) -> ControlFlow < OrphanCheckEarlyExit < I , E > > {
291294 if self . search_first_local_ty {
292295 return ControlFlow :: Continue ( ( ) ) ;
293296 }
@@ -305,23 +308,23 @@ where
305308
306309enum OrphanCheckEarlyExit < I : Interner , E > {
307310 NormalizationFailure ( E ) ,
308- UncoveredTyParam ( I :: Ty ) ,
309- LocalTy ( I :: Ty ) ,
311+ UncoveredTyParam ( ty :: Ty < I > ) ,
312+ LocalTy ( ty :: Ty < I > ) ,
310313}
311314
312315impl < ' a , Infcx , I , F , E > TypeVisitor < I > for OrphanChecker < ' a , Infcx , I , F >
313316where
314317 Infcx : InferCtxtLike < Interner = I > ,
315318 I : Interner ,
316- F : FnMut ( I :: Ty ) -> Result < I :: Ty , E > ,
319+ F : FnMut ( ty :: Ty < I > ) -> Result < ty :: Ty < I > , E > ,
317320{
318321 type Result = ControlFlow < OrphanCheckEarlyExit < I , E > > ;
319322
320323 fn visit_region ( & mut self , _r : I :: Region ) -> Self :: Result {
321324 ControlFlow :: Continue ( ( ) )
322325 }
323326
324- fn visit_ty ( & mut self , ty : I :: Ty ) -> Self :: Result {
327+ fn visit_ty ( & mut self , ty : ty :: Ty < I > ) -> Self :: Result {
325328 let ty = self . infcx . shallow_resolve ( ty) ;
326329 let ty = match ( self . lazily_normalize_ty ) ( ty) {
327330 Ok ( norm_ty) if norm_ty. is_ty_var ( ) => ty,
0 commit comments