-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
c"…"
literals are handled incorrectly by proc_macro::Literal
#112820
Labels
A-proc-macros
Area: Procedural macros
C-bug
Category: This is a bug.
F-c_str_literals
`#![feature(c_str_literals)]`
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
dtolnay
added
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
C-bug
Category: This is a bug.
A-proc-macros
Area: Procedural macros
F-c_str_literals
`#![feature(c_str_literals)]`
labels
Jun 20, 2023
12 tasks
@rustbot claim |
Does #113476 resolve this or is there more? |
Not fixed as of rustc 1.73.0-nightly (8131b97 2023-08-02). |
vincenzopalazzo
added a commit
to vincenzopalazzo/rust
that referenced
this issue
Sep 23, 2023
While I am working on trying to patch rust-lang#112820 I think it is useful to have a test for this case as known-bug Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo
added a commit
to vincenzopalazzo/rust
that referenced
this issue
Sep 24, 2023
While I am working on trying to patch rust-lang#112820 I think it is useful to have a test for this case as known-bug Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo
added a commit
to vincenzopalazzo/rust
that referenced
this issue
Sep 24, 2023
While I am working on trying to patch rust-lang#112820 I think it is useful to have a test for this case as known-bug Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 25, 2023
…to-string, r=compiler-errors Properly print cstr literals in `proc_macro::Literal::to_string` Previously we printed the contents of the string, rather than the actual string literal (e.g. `the c string` instead of `c"the c string"`). Fixes rust-lang#112820 cc rust-lang#105723
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 25, 2023
…to-string, r=compiler-errors Properly print cstr literals in `proc_macro::Literal::to_string` Previously we printed the contents of the string, rather than the actual string literal (e.g. `the c string` instead of `c"the c string"`). Fixes rust-lang#112820 cc rust-lang#105723
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-proc-macros
Area: Procedural macros
C-bug
Category: This is a bug.
F-c_str_literals
`#![feature(c_str_literals)]`
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Current output as of nightly-2023-06-20:
The correct output would have
c"cstr"
.The ToString of proc_macro::Literal is the only interface by which proc macros are able to inspect literals. It is supposed to include the entire literal, with quotes and escape sequences and everything as originally appear in the source code. Without this, it is impossible for proc macros to operate correctly on
c"…"
literals. For example, it would currently be impossible for a proc macro to tell the difference betweenb'B'
andc"b'B'"
, but those are not the same token.Mentioning tracking issue: #105723.
Mentioning @fee1-dead since you have worked on this feature in the past.
The text was updated successfully, but these errors were encountered: