@@ -43,11 +43,11 @@ pub enum PathResolution {
43
43
}
44
44
45
45
impl PathResolution {
46
- fn in_type_ns ( self ) -> Option < TypeNs > {
46
+ fn in_type_ns ( & self ) -> Option < TypeNs > {
47
47
match self {
48
- PathResolution :: Def ( ModuleDef :: Adt ( adt) ) => Some ( TypeNs :: AdtId ( adt. into ( ) ) ) ,
48
+ PathResolution :: Def ( ModuleDef :: Adt ( adt) ) => Some ( TypeNs :: AdtId ( ( * adt) . into ( ) ) ) ,
49
49
PathResolution :: Def ( ModuleDef :: BuiltinType ( builtin) ) => {
50
- Some ( TypeNs :: BuiltinType ( builtin) )
50
+ Some ( TypeNs :: BuiltinType ( * builtin) )
51
51
}
52
52
PathResolution :: Def ( ModuleDef :: Const ( _) ) => None ,
53
53
PathResolution :: Def ( ModuleDef :: EnumVariant ( _) ) => None ,
@@ -56,16 +56,16 @@ impl PathResolution {
56
56
PathResolution :: Def ( ModuleDef :: Static ( _) ) => None ,
57
57
PathResolution :: Def ( ModuleDef :: Trait ( _) ) => None ,
58
58
PathResolution :: Def ( ModuleDef :: TypeAlias ( alias) ) => {
59
- Some ( TypeNs :: TypeAliasId ( alias. into ( ) ) )
59
+ Some ( TypeNs :: TypeAliasId ( ( * alias) . into ( ) ) )
60
60
}
61
61
PathResolution :: Local ( _) => None ,
62
- PathResolution :: TypeParam ( param) => Some ( TypeNs :: GenericParam ( param. into ( ) ) ) ,
63
- PathResolution :: SelfType ( impl_def) => Some ( TypeNs :: SelfType ( impl_def. into ( ) ) ) ,
62
+ PathResolution :: TypeParam ( param) => Some ( TypeNs :: GenericParam ( ( * param) . into ( ) ) ) ,
63
+ PathResolution :: SelfType ( impl_def) => Some ( TypeNs :: SelfType ( ( * impl_def) . into ( ) ) ) ,
64
64
PathResolution :: Macro ( _) => None ,
65
65
PathResolution :: AssocItem ( AssocItem :: Const ( _) ) => None ,
66
66
PathResolution :: AssocItem ( AssocItem :: Function ( _) ) => None ,
67
67
PathResolution :: AssocItem ( AssocItem :: TypeAlias ( alias) ) => {
68
- Some ( TypeNs :: TypeAliasId ( alias. into ( ) ) )
68
+ Some ( TypeNs :: TypeAliasId ( ( * alias) . into ( ) ) )
69
69
}
70
70
}
71
71
}
@@ -77,7 +77,7 @@ impl PathResolution {
77
77
db : & dyn HirDatabase ,
78
78
mut cb : impl FnMut ( TypeAlias ) -> Option < R > ,
79
79
) -> Option < R > {
80
- if let Some ( res) = self . clone ( ) . in_type_ns ( ) {
80
+ if let Some ( res) = self . in_type_ns ( ) {
81
81
associated_type_shorthand_candidates ( db, res, |_, _, id| cb ( id. into ( ) ) )
82
82
} else {
83
83
None
0 commit comments