Skip to content

Reserve guarded string literals (RFC 3593)#123951

Merged
bors merged 1 commit intorust-lang:masterfrom
pitaj:reserve-guarded-strings
Oct 10, 2024
Merged

Reserve guarded string literals (RFC 3593)#123951
bors merged 1 commit intorust-lang:masterfrom
pitaj:reserve-guarded-strings

Conversation

@pitaj
Copy link
Copy Markdown
Contributor

@pitaj pitaj commented Apr 15, 2024

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

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-unprefixed_guarded_strings `#![feature(unprefixed_guarded_strings)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.