-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
RFC: Reserved prefixes in the 2021 edition #3101
Conversation
Co-authored-by: Josh Triplett <[email protected]>
Co-authored-by: Josh Triplett <[email protected]>
Co-authored-by: Josh Triplett <[email protected]>
This looks great. :) |
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.
+1 on the idea; we also discussed this at our most recent @rust-lang/lang meeting and folks were in favor then.
Left a few nits.
how about also adding |
Ah yes, I totally forgot about char literals; if we go through with this for string literals, it seems to make sense to go through with it for chars as well. And I'd propose to reserve |
I feel like reserving character literals and numbers seems reasonable. |
I've pushed changes based on the feedback here and on Zulip. Highlights:
|
I think |
Can you explain in more detail what you'd like to reserve and why? |
now that I'm typing this, I realized we should also add Though maybe we should just reserve everything of the form All of the above doesn't mean discarding reservations for things without Obviously the pre-existing syntax (such as |
@programmerjake , note that the RFC as written does indeed reserve this syntax for raw string literals (for all possible quantities of surrounding WRT "reserve everything of the form |
@rfcbot fcp merge In our 2021-04-06 meeting, we decided that we'd like to move forward with this RFC. There were also a few other notes with respect to the right time to report an error and so forth (we felt reporting the error during tokenization time would be better, gives us maximal choices later). |
Team member @nikomatsakis has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Thanks for the proposal, @nikomatsakis, and thanks for the update, @bstrie! |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
Since this makes the lexer edition-dependent, what will this mean for |
Maybe deprecate it and add a new function that takes an edition parameter? |
That's a good question, @m-ou-se =) I'd like to know a bit more about how that function is used in practice. It seems clear that the ideal would be to use the edition of the crate from which that string originated, but without any span, we can't know that. We could indeed deprecate in favor of an API that takes span information-- I'm not overly familiar with that crate, does such an API already exist? I was planning on merging this RFC, and I think I will do so, but I'll add this to the list of unresolved question and open an issue for follow-up. |
Huzzah! The @rust-lang/lang team has decided to accept this RFC. Please follow along on the tracking issue rust-lang/rust#84978. |
Beginning with the 2021 edition, reserve the syntax
ident#foo
,ident"foo"
,ident'f'
, andident#123
, as a way of future-proofing against future language changes.Rendered