You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if someone tries to reference a field that doesn't exist in the current struct an error is produced and recommendations are provided, this is wonderful.
However, I think that it could be made even better by adding some addition suggestions. What would these be?
Referring back to my first example I would say that having 'state.tokens' in addition to the other names would be beneficial. To do this, if this error comes up then the the tree which is the name paths of the fields of each of the structs is traversed in order to find these additional suggestions.
Caveats:
Structs that are not 'pub' should not be traversed through. I say this so that such things which cannot be recommended if they cannot be actually accessed.
There should be a default depth, say 5, which is configurable either on the command line or when using cargo
The text was updated successfully, but these errors were encountered:
Nokel81
changed the title
More path options for struct fields don't exist
More path suggestions for when a struct field doesn't exist
Jun 12, 2018
Centril
added
the
T-lang
Relevant to the language team, which will review and decide on the RFC.
label
Jun 12, 2018
See this playground:
Currently, if someone tries to reference a field that doesn't exist in the current struct an error is produced and recommendations are provided, this is wonderful.
However, I think that it could be made even better by adding some addition suggestions. What would these be?
Referring back to my first example I would say that having
'state.tokens'
in addition to the other names would be beneficial. To do this, if this error comes up then the the tree which is the name paths of the fields of each of the structs is traversed in order to find these additional suggestions.Caveats:
The text was updated successfully, but these errors were encountered: