@@ -286,7 +286,7 @@ fn orphan_check<'tcx>(
286286 tcx : TyCtxt < ' tcx > ,
287287 impl_def_id : LocalDefId ,
288288 mode : OrphanCheckMode ,
289- ) -> Result < ( ) , OrphanCheckErr < ' tcx , FxIndexSet < DefId > > > {
289+ ) -> Result < ( ) , OrphanCheckErr < TyCtxt < ' tcx > , FxIndexSet < DefId > > > {
290290 // We only accept this routine to be invoked on implementations
291291 // of a trait, not inherent implementations.
292292 let trait_ref = tcx. impl_trait_ref ( impl_def_id) . unwrap ( ) ;
@@ -326,17 +326,16 @@ fn orphan_check<'tcx>(
326326 ty
327327 } ;
328328
329- Ok ( ty)
329+ Ok :: < _ , ! > ( ty)
330330 } ;
331331
332- let Ok ( result) = traits:: orphan_check_trait_ref :: < ! > (
332+ let result = traits:: orphan_check_trait_ref (
333333 & infcx,
334334 trait_ref,
335335 traits:: InCrate :: Local { mode } ,
336336 lazily_normalize_ty,
337- ) else {
338- unreachable ! ( )
339- } ;
337+ )
338+ . into_ok ( ) ;
340339
341340 // (2) Try to map the remaining inference vars back to generic params.
342341 result. map_err ( |err| match err {
@@ -369,7 +368,7 @@ fn emit_orphan_check_error<'tcx>(
369368 tcx : TyCtxt < ' tcx > ,
370369 trait_ref : ty:: TraitRef < ' tcx > ,
371370 impl_def_id : LocalDefId ,
372- err : traits:: OrphanCheckErr < ' tcx , FxIndexSet < DefId > > ,
371+ err : traits:: OrphanCheckErr < TyCtxt < ' tcx > , FxIndexSet < DefId > > ,
373372) -> ErrorGuaranteed {
374373 match err {
375374 traits:: OrphanCheckErr :: NonLocalInputType ( tys) => {
@@ -482,7 +481,7 @@ fn emit_orphan_check_error<'tcx>(
482481
483482fn lint_uncovered_ty_params < ' tcx > (
484483 tcx : TyCtxt < ' tcx > ,
485- UncoveredTyParams { uncovered, local_ty } : UncoveredTyParams < ' tcx , FxIndexSet < DefId > > ,
484+ UncoveredTyParams { uncovered, local_ty } : UncoveredTyParams < TyCtxt < ' tcx > , FxIndexSet < DefId > > ,
486485 impl_def_id : LocalDefId ,
487486) {
488487 let hir_id = tcx. local_def_id_to_hir_id ( impl_def_id) ;
0 commit comments