-
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: Reserve unprefixed guarded string literals in Edition 2024 #3593
Conversation
975f598
to
67e96a4
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Very much in favor of reserving this syntax. Starting an FCP so we can check for consensus asynchronously, in addition to discussing this at a future meeting. @rfcbot merge |
Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. 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! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
@rfcbot reviewed It would be nice if we could do a crater run to tell the impact on any macros, but +1 to reserving the syntax in any case. |
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. This will be merged soon. |
The FCP for RFC 3593 has completed, so let's prepare it to be merged. In this case, that means changing the file name to use dashes rather than underscores as separators and updating the tracking issue.
89e4d41
to
0956625
Compare
The lang team has accepted this RFC, and we've now merged it. Thanks to @pitaj for pushing this forward, and thanks to all those who reviewed this RFC and provided helpful feedback. For further updates on this work, follow the tracking issue: |
Experiment: Reserve guarded string literal syntax (RFC 3593) on all editions Purpose: crater run to see if we even need to make this change on an edition boundary. This syntax change applies to all editions, because the particular syntax `#"foo"#` is unlikely to exist in the wild. Subset of rust-lang#123951 Tracking issue: rust-lang#123735 RFC: rust-lang/rfcs#3593
…viscross Reserve guarded string literals (RFC 3593) Implementation for RFC 3593, including: - lexer / parser changes - diagnostics - migration lint - tests We reserve `#"`, `##"`, `###"`, `####`, and any other string of four or more repeated `#`. This avoids infinite lookahead in the lexer, though we still use infinite lookahead in the parser to provide better forward compatibility diagnostics. This PR does not implement any special lexing of the string internals: - strings preceded by one or more `#` are denied - regardless of the number of trailing `#` - string contents are lexed as if it was just a bare `"string"` Tracking issue: rust-lang#123735 RFC: rust-lang/rfcs#3593
…raviscross Reserve guarded string literals (RFC 3593) Implementation for RFC 3593, including: - lexer / parser changes - diagnostics - migration lint - tests We reserve `#"`, `##"`, `###"`, `####`, and any other string of four or more repeated `#`. This avoids infinite lookahead in the lexer, though we still use infinite lookahead in the parser to provide better forward compatibility diagnostics. This PR does not implement any special lexing of the string internals: - strings preceded by one or more `#` are denied - regardless of the number of trailing `#` - string contents are lexed as if it was just a bare `"string"` Tracking issue: rust-lang#123735 RFC: rust-lang/rfcs#3593
Rollup merge of rust-lang#123951 - pitaj:reserve-guarded-strings, r=traviscross Reserve guarded string literals (RFC 3593) Implementation for RFC 3593, including: - lexer / parser changes - diagnostics - migration lint - tests We reserve `#"`, `##"`, `###"`, `####`, and any other string of four or more repeated `#`. This avoids infinite lookahead in the lexer, though we still use infinite lookahead in the parser to provide better forward compatibility diagnostics. This PR does not implement any special lexing of the string internals: - strings preceded by one or more `#` are denied - regardless of the number of trailing `#` - string contents are lexed as if it was just a bare `"string"` Tracking issue: rust-lang#123735 RFC: rust-lang/rfcs#3593
Reserve guarded string literals (RFC 3593) Implementation for RFC 3593, including: - lexer / parser changes - diagnostics - migration lint - tests We reserve `#"`, `##"`, `###"`, `####`, and any other string of four or more repeated `#`. This avoids infinite lookahead in the lexer, though we still use infinite lookahead in the parser to provide better forward compatibility diagnostics. This PR does not implement any special lexing of the string internals: - strings preceded by one or more `#` are denied - regardless of the number of trailing `#` - string contents are lexed as if it was just a bare `"string"` Tracking issue: #123735 RFC: rust-lang/rfcs#3593
Beginning with the 2024 edition, reserve the syntax
#"foo"#
, as a way of future-proofing against future language changes.Rendered
Note: much of the text of this RFC is directly adapted from #3101. Thank you to @bstrie and all other contributors there for paving the path.