-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Why are doc comments parsed as raw string? #771
Comments
The reference is wrong. ;) |
Here is how to see rustc's parse: macro_rules! m {
(#[doc = $tt:tt]) => { stringify!($tt) };
}
fn main() {
println!(m! {
///test
});
} |
Thanks for the quick reply with a great example! |
kraktus
added a commit
to kraktus/reference
that referenced
this issue
Dec 27, 2022
kraktus
added a commit
to kraktus/rust
that referenced
this issue
Dec 27, 2022
This can actually make a difference for the user if they rely on unicode formating. Prompted by dtolnay/syn#771
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this issue
Dec 27, 2022
Fix doc comment parsing description in book This can actually make a difference for the user if they rely on unicode formating. Prompted by dtolnay/syn#771
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. I have a question.
https://github.com/dtolnay/syn/blob/master/src/attr.rs#L119-L150
The above code tells me that doc comments like
/// foobar
are transformed into#[doc = r"foobar"]
.However, The Rust Reference says:
Why does this crate parse doc comments as raw string, unlike the rust compiler?
The text was updated successfully, but these errors were encountered: