@@ -883,18 +883,25 @@ fn classify_name_ref(
883
883
}
884
884
} ;
885
885
let make_path_kind_type = |ty : ast:: Type | {
886
- let location = type_location ( ty. syntax ( ) ) ;
887
- if let Some ( p) = ty. syntax ( ) . parent ( ) {
888
- if ast:: GenericArg :: can_cast ( p. kind ( ) ) || ast:: GenericArgList :: can_cast ( p. kind ( ) ) {
889
- if let Some ( p) = p. parent ( ) . and_then ( |p| p. parent ( ) ) {
890
- if let Some ( segment) = ast:: PathSegment :: cast ( p) {
891
- let path = segment. parent_path ( ) . top_path ( ) ;
892
- dbg ! ( sema. resolve_path( & path) ) ;
893
- }
886
+ let location = type_location ( ty. syntax ( ) ) . unwrap_or ( TypeLocation :: Other ) ;
887
+ match & location {
888
+ TypeLocation :: TupleField => ( ) ,
889
+ TypeLocation :: TypeAscription ( _) => ( ) ,
890
+ TypeLocation :: GenericArgList ( args) => {
891
+ dbg ! ( & args) ;
892
+ if let Some ( segment) =
893
+ args. as_ref ( ) . and_then ( |args| ast:: PathSegment :: cast ( args. syntax ( ) . parent ( ) ?) )
894
+ {
895
+ let path = dbg ! ( segment. parent_path( ) . top_path( ) ) ;
896
+ dbg ! ( sema. resolve_path( & path) ) ;
894
897
}
895
898
}
899
+ TypeLocation :: TypeBound => ( ) ,
900
+ TypeLocation :: ImplTarget => ( ) ,
901
+ TypeLocation :: ImplTrait => ( ) ,
902
+ TypeLocation :: Other => ( ) ,
896
903
}
897
- PathKind :: Type { location : location . unwrap_or ( TypeLocation :: Other ) }
904
+ PathKind :: Type { location }
898
905
} ;
899
906
900
907
let mut kind_macro_call = |it : ast:: MacroCall | {
0 commit comments