@@ -15,7 +15,7 @@ use hir_def::{
15
15
} ,
16
16
expr:: { ExprId , Pat , PatId } ,
17
17
path:: { ModPath , Path , PathKind } ,
18
- resolver:: { resolver_for_scope, Resolver , TypeNs , ValueNs } ,
18
+ resolver:: { resolver_for_scope, HasResolver , Resolver , TypeNs , ValueNs } ,
19
19
AsMacroCall , DefWithBodyId , FieldId , FunctionId , LocalFieldId , VariantId ,
20
20
} ;
21
21
use hir_expand:: { hygiene:: Hygiene , name:: AsName , HirFileId , InFile } ;
@@ -544,6 +544,17 @@ fn resolve_hir_path_(
544
544
}
545
545
}
546
546
} ?;
547
+
548
+ if let ( Some ( _) , TypeNs :: TraitId ( trait_id) ) = ( & unresolved, & ty) {
549
+ let resolver = trait_id. resolver ( db. upcast ( ) ) ;
550
+ if let Some ( module_def_id) = resolver
551
+ . resolve_module_path_in_trait_assoc_items ( db. upcast ( ) , path. mod_path ( ) )
552
+ . and_then ( |ns| ns. take_types ( ) )
553
+ {
554
+ return Some ( PathResolution :: Def ( module_def_id. into ( ) ) ) ;
555
+ }
556
+ }
557
+
547
558
let res = match ty {
548
559
TypeNs :: SelfType ( it) => PathResolution :: SelfType ( it. into ( ) ) ,
549
560
TypeNs :: GenericParam ( id) => PathResolution :: TypeParam ( TypeParam { id } ) ,
0 commit comments