@@ -914,8 +914,7 @@ impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P> {
914914 let assoc_segment =
915915 fhir:: PathSegment { args : & [ ] , constraints : & [ ] , ident, res : fhir:: Res :: Err } ;
916916 let mut env = Env :: empty ( ) ;
917- let alias_ty =
918- self . conv_type_relative_type_path ( & mut env, ident. span , res, & assoc_segment) ?;
917+ let alias_ty = self . conv_type_relative_type_path ( & mut env, res, & assoc_segment) ?;
919918 return Ok ( rty:: Sort :: Alias ( rty:: AliasKind :: Projection , alias_ty) ) ;
920919 }
921920 fhir:: SortRes :: PrimSort ( fhir:: PrimSort :: Set ) => {
@@ -1444,7 +1443,7 @@ impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P> {
14441443 let qself_res =
14451444 if let Some ( path) = qself. as_path ( ) { path. res } else { fhir:: Res :: Err } ;
14461445 let alias_ty = self
1447- . conv_type_relative_type_path ( env, qself . span , qself_res, segment) ?
1446+ . conv_type_relative_type_path ( env, qself_res, segment) ?
14481447 . shift_in_escaping ( 1 ) ;
14491448 let bty = rty:: BaseTy :: Alias ( rty:: AliasKind :: Projection , alias_ty) ;
14501449 let sort = bty. sort ( ) ;
@@ -1464,18 +1463,14 @@ impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P> {
14641463 fn conv_type_relative_path < Tag : AssocItemTag > (
14651464 & mut self ,
14661465 tag : Tag ,
1467- qself_span : Span ,
14681466 qself_res : fhir:: Res ,
14691467 assoc_ident : Ident ,
14701468 ) -> QueryResult < ( Tag :: AssocItem < ' tcx > , rty:: TraitRef ) > {
14711469 let tcx = self . tcx ( ) ;
14721470
14731471 let bound = match qself_res {
14741472 fhir:: Res :: SelfTyAlias { alias_to : impl_def_id, is_trait_impl : true } => {
1475- let Some ( trait_ref) = tcx. impl_trait_ref ( impl_def_id) else {
1476- // A cycle error occurred most likely (comment copied from rustc)
1477- span_bug ! ( qself_span, "expected cycle error" ) ;
1478- } ;
1473+ let trait_ref = tcx. impl_trait_ref ( impl_def_id) ;
14791474
14801475 self . probe_single_bound_for_assoc_item (
14811476 || {
@@ -1535,16 +1530,11 @@ impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P> {
15351530 fn conv_type_relative_type_path (
15361531 & mut self ,
15371532 env : & mut Env ,
1538- qself_span : Span ,
15391533 qself_res : fhir:: Res ,
15401534 assoc_segment : & fhir:: PathSegment ,
15411535 ) -> QueryResult < rty:: AliasTy > {
1542- let ( assoc_item, trait_ref) = self . conv_type_relative_path (
1543- AssocTag :: Type ,
1544- qself_span,
1545- qself_res,
1546- assoc_segment. ident ,
1547- ) ?;
1536+ let ( assoc_item, trait_ref) =
1537+ self . conv_type_relative_path ( AssocTag :: Type , qself_res, assoc_segment. ident ) ?;
15481538
15491539 let assoc_id = assoc_item. def_id ;
15501540 let mut args = trait_ref. args . to_vec ( ) ;
@@ -2469,7 +2459,7 @@ impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P> {
24692459 let qself_res =
24702460 if let Some ( path) = qself. as_path ( ) { path. res } else { fhir:: Res :: Err } ;
24712461 let ( assoc_reft, trait_ref) =
2472- self . conv_type_relative_path ( AssocReftTag , qself . span , qself_res, * name) ?;
2462+ self . conv_type_relative_path ( AssocReftTag , qself_res, * name) ?;
24732463 rty:: AliasReft { assoc_id : assoc_reft. def_id , args : trait_ref. args }
24742464 }
24752465 } ;
0 commit comments