-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace stringN
type names with String<N>
#379
Comments
Yeah, would be nice to retire the |
Lets make this |
stringN
type names with string<N>
stringN
type names with String<N>
The complicated part of this is that the generic syntax will have to be allowed in a type constructor call, eg This ambiguity is the reason for rust's "turbofish" syntax. However, I think we should take the approach outlined in this RFC: https://github.com/varkor/rfcs/blob/undisambiguated_generics/text/0000-undisambiguated-generics.md Basically, just resolve the ambiguity in favor of generics (and probably disallow chained comparisons while we're at it). This will add complexity to the parser, but I think that's better than adding the ugliness of the turbofish to the language. Here's a summary of the crazy discussion thread that the rfc spawned: rust-lang/rfcs#2544 (comment) Note that I haven't entirely read either of those links, but I think the general sentiment among the rust lang team was to accept the rfc (before the conversation derailed and was closed), and my inclination is to follow their lead. |
What is wrong?
The parser will parse
string<100>
etc as aTypeDesc::Generic
, so it's time to retire the oldstring100
syntax in favor of the const generic style. We should also dobytes<N>
, if we're keeping the bytes type. (See #258)How can it be fixed
The text was updated successfully, but these errors were encountered: