@@ -749,22 +749,23 @@ fn resolve_hir_path_qualifier(
749
749
resolver : & Resolver ,
750
750
path : & Path ,
751
751
) -> Option < PathResolution > {
752
- let items = resolver
753
- . resolve_module_path_in_items ( db. upcast ( ) , path. mod_path ( ) )
754
- . take_types ( )
755
- . map ( |it| PathResolution :: Def ( it. into ( ) ) ) ;
756
-
757
- if items. is_some ( ) {
758
- return items;
759
- }
760
-
761
- resolver. resolve_path_in_type_ns_fully ( db. upcast ( ) , path. mod_path ( ) ) . map ( |ty| match ty {
762
- TypeNs :: SelfType ( it) => PathResolution :: SelfType ( it. into ( ) ) ,
763
- TypeNs :: GenericParam ( id) => PathResolution :: TypeParam ( id. into ( ) ) ,
764
- TypeNs :: AdtSelfType ( it) | TypeNs :: AdtId ( it) => PathResolution :: Def ( Adt :: from ( it) . into ( ) ) ,
765
- TypeNs :: EnumVariantId ( it) => PathResolution :: Def ( Variant :: from ( it) . into ( ) ) ,
766
- TypeNs :: TypeAliasId ( it) => PathResolution :: Def ( TypeAlias :: from ( it) . into ( ) ) ,
767
- TypeNs :: BuiltinType ( it) => PathResolution :: Def ( BuiltinType :: from ( it) . into ( ) ) ,
768
- TypeNs :: TraitId ( it) => PathResolution :: Def ( Trait :: from ( it) . into ( ) ) ,
769
- } )
752
+ resolver
753
+ . resolve_path_in_type_ns_fully ( db. upcast ( ) , path. mod_path ( ) )
754
+ . map ( |ty| match ty {
755
+ TypeNs :: SelfType ( it) => PathResolution :: SelfType ( it. into ( ) ) ,
756
+ TypeNs :: GenericParam ( id) => PathResolution :: TypeParam ( id. into ( ) ) ,
757
+ TypeNs :: AdtSelfType ( it) | TypeNs :: AdtId ( it) => {
758
+ PathResolution :: Def ( Adt :: from ( it) . into ( ) )
759
+ }
760
+ TypeNs :: EnumVariantId ( it) => PathResolution :: Def ( Variant :: from ( it) . into ( ) ) ,
761
+ TypeNs :: TypeAliasId ( it) => PathResolution :: Def ( TypeAlias :: from ( it) . into ( ) ) ,
762
+ TypeNs :: BuiltinType ( it) => PathResolution :: Def ( BuiltinType :: from ( it) . into ( ) ) ,
763
+ TypeNs :: TraitId ( it) => PathResolution :: Def ( Trait :: from ( it) . into ( ) ) ,
764
+ } )
765
+ . or_else ( || {
766
+ resolver
767
+ . resolve_module_path_in_items ( db. upcast ( ) , path. mod_path ( ) )
768
+ . take_types ( )
769
+ . map ( |it| PathResolution :: Def ( it. into ( ) ) )
770
+ } )
770
771
}
0 commit comments