@@ -1610,6 +1610,8 @@ impl Disambiguator {
16101610 return Suggestion :: Macro ;
16111611 } else if kind == DefKind :: Fn || kind == DefKind :: AssocFn {
16121612 return Suggestion :: Function ;
1613+ } else if kind == DefKind :: Field {
1614+ return Suggestion :: RemoveDisambiguator ;
16131615 }
16141616
16151617 let prefix = match kind {
@@ -1674,6 +1676,8 @@ enum Suggestion {
16741676 Function ,
16751677 /// `m!`
16761678 Macro ,
1679+ /// `foo` without any disambiguator
1680+ RemoveDisambiguator ,
16771681}
16781682
16791683impl Suggestion {
@@ -1682,6 +1686,7 @@ impl Suggestion {
16821686 Self :: Prefix ( x) => format ! ( "prefix with `{}@`" , x) . into ( ) ,
16831687 Self :: Function => "add parentheses" . into ( ) ,
16841688 Self :: Macro => "add an exclamation mark" . into ( ) ,
1689+ Self :: RemoveDisambiguator => "remove the disambiguator" . into ( ) ,
16851690 }
16861691 }
16871692
@@ -1691,6 +1696,7 @@ impl Suggestion {
16911696 Self :: Prefix ( prefix) => format ! ( "{}@{}" , prefix, path_str) ,
16921697 Self :: Function => format ! ( "{}()" , path_str) ,
16931698 Self :: Macro => format ! ( "{}!" , path_str) ,
1699+ Self :: RemoveDisambiguator => path_str. into ( ) ,
16941700 }
16951701 }
16961702}
0 commit comments