You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All of the following I'm going to describe happens only when expanding doc comments in a macro, using meta fragments, in other contexts it works fine, so it indeed is a thing! A sample of doc comments expansion in a macro can be found at #25929 so I'll skip samples and go direct to the point.
If I use a escape sequence of usual strings it seems to expand it right there on rustdoc.
I have found the issue by trying to do something like the following:
The text was updated successfully, but these errors were encountered:
thelink2012
changed the title
rustdoc does not expand doc fragments of macros properly
rustdoc does not expand escape sequences in doc fragments of macros properly
Jun 1, 2015
Escape sequences in documentation comments must not be parsed as a
normal string when expanding a macro, otherwise some innocent but
invalid-escape-sequence-looking comments will trigger an ICE.
Although this commit replaces normal string literals with raw string
literals in macro expansion, this shouldn't be much a problem
considering documentation comments are converted into attributes before
being passed to a macro anyways.
Fixesrust-lang#25929.
Fixesrust-lang#25943.
Escape sequences in documentation comments must not be parsed as a normal string when expanding a macro, otherwise some innocent but invalid-escape-sequence-looking comments will trigger an ICE.
Although this commit replaces normal string literals with raw string literals in macro expansion, this shouldn't be much a problem considering documentation comments are converted into attributes before being passed to a macro anyways.
Fixesrust-lang#25929.
Fixesrust-lang#25943.
All of the following I'm going to describe happens only when expanding doc comments in a macro, using meta fragments, in other contexts it works fine, so it indeed is a thing! A sample of doc comments expansion in a macro can be found at #25929 so I'll skip samples and go direct to the point.
If I use a escape sequence of usual strings it seems to expand it right there on rustdoc.
I have found the issue by trying to do something like the following:
When I run
cargo doc
I get this panic:When using the
\0
outside a code block it does not happen, but if I try a hexadecimal literal outside the code block instead it still panics.I get
Interesting but let's try something that is not a null character to see what happens:
Ha! I get a
a
in my html output!Meta
The text was updated successfully, but these errors were encountered: