@@ -385,31 +385,32 @@ impl Ty {
385
385
segment : PathSegment < ' _ > ,
386
386
) -> Ty {
387
387
if let Some ( res) = res {
388
- let ty = associated_types ( ctx. db , res, move |name, t, associated_ty| {
389
- if name == segment. name {
390
- let substs = match ctx. type_param_mode {
391
- TypeParamLoweringMode :: Placeholder => {
392
- // if we're lowering to placeholders, we have to put
393
- // them in now
394
- let s = Substs :: type_params (
395
- ctx. db ,
396
- ctx. resolver
397
- . generic_def ( )
398
- . expect ( "there should be generics if there's a generic param" ) ,
399
- ) ;
400
- t. substs . clone ( ) . subst_bound_vars ( & s)
401
- }
402
- TypeParamLoweringMode :: Variable => t. substs . clone ( ) ,
403
- } ;
404
- // FIXME handle type parameters on the segment
405
- return Some ( Ty :: Projection ( ProjectionTy {
406
- associated_ty,
407
- parameters : substs,
408
- } ) ) ;
409
- }
388
+ let ty =
389
+ associated_type_shorthand_candidates ( ctx. db , res, move |name, t, associated_ty| {
390
+ if name == segment. name {
391
+ let substs = match ctx. type_param_mode {
392
+ TypeParamLoweringMode :: Placeholder => {
393
+ // if we're lowering to placeholders, we have to put
394
+ // them in now
395
+ let s = Substs :: type_params (
396
+ ctx. db ,
397
+ ctx. resolver . generic_def ( ) . expect (
398
+ "there should be generics if there's a generic param" ,
399
+ ) ,
400
+ ) ;
401
+ t. substs . clone ( ) . subst_bound_vars ( & s)
402
+ }
403
+ TypeParamLoweringMode :: Variable => t. substs . clone ( ) ,
404
+ } ;
405
+ // FIXME handle type parameters on the segment
406
+ return Some ( Ty :: Projection ( ProjectionTy {
407
+ associated_ty,
408
+ parameters : substs,
409
+ } ) ) ;
410
+ }
410
411
411
- None
412
- } ) ;
412
+ None
413
+ } ) ;
413
414
414
415
ty. unwrap_or ( Ty :: Unknown )
415
416
} else {
@@ -671,7 +672,7 @@ pub fn callable_item_sig(db: &dyn HirDatabase, def: CallableDef) -> PolyFnSig {
671
672
}
672
673
}
673
674
674
- pub fn associated_types < R > (
675
+ pub fn associated_type_shorthand_candidates < R > (
675
676
db : & dyn HirDatabase ,
676
677
res : TypeNs ,
677
678
mut cb : impl FnMut ( & Name , & TraitRef , TypeAliasId ) -> Option < R > ,
0 commit comments