-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Reserve prefixed identifiers and literals (RFC 3101) #85359
Conversation
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
582d02e
to
4424c8c
Compare
cc #84037 (one more in-progress implementation) @Julian-Wollersberger |
Could you assign this to me for the final implementation review, once it's decided who will implement this and what are the rules regarding raw strings etc. |
I guess it mainly focuses on implements the
OK, I'll do this. Thanks for your detailed feedback! |
Yes, and #84037 touches almost the same code. But since the |
@Julian-Wollersberger Yes, it sounds good. Sorry for the reply delay since I'm really busy in the past several days. I don't think we have reached an agreement on the implementation details now (see discussions at #84978), so this PR may also take some time and the code may be completely rewritten. |
I think you @'ed the wrong jack @lrh2000 |
Oops, what a big mistake! I've fixed this and really sorry to bother you. |
Hope you don't mind, but I pushed the changes i suggested above, and added a migration lint for |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I left some nits.
This comment has been minimized.
This comment has been minimized.
dbf85fa
to
8a7b3ae
Compare
Co-authored-by: Niko Matsakis <[email protected]>
4e70c36
to
2bcd663
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
r? @nikomatsakis @bors r=nikomatsakis |
📌 Commit f6dd137 has been approved by |
☀️ Test successful - checks-actions |
This may be known to most people here but Scala allows people to make their own prefixes, say I'd love to see that being supported by compiler and a very small number of useful individual prefixes in the std-lib. |
This PR denies any identifiers immediately followed by one of three tokens
"
,'
or#
, which is stricter than the requirements of RFC 3101 but may be necessary according to the discussion at Zulip.The tracking issue #84599 says we'll add a feature gate named
reserved_prefixes
, but I don't think I can do this because it is impossible for the lexer to know whether a feature is enabled or not. I guess determining the behavior by the edition information should be enough.Fixes #84599