Description
This issue was discovered in this PR on displaydoc yaahc/displaydoc#22 (comment) and previously reported in this zulip thread https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/block.20doc.20comments.20broken.3F.
To summarize the issue, previously if you had a multiple line block doc comment that had asterisks on the start of each line the asterisks were stripped by rustc prior to them being passed into proc macros. After the change the asterisks are left in and must be removed by the author of a proc macro.
Code
Based on this PR where we worked around the issue:
I tried this code in a proc macro:
/**
* line 1
*
* line 2
*/
struct Foo;
I expected to see as the content of the #[doc]
attribute:
"line 1\n\n line2"
Instead, I see this as the content of the attribute:
"* line 1\n *\n * line 2"
note: github isn't displaying this well but this includes all leading white space as well, so a newline, five spaces, then an astrisk, repeat.
Version it worked on
It most recently worked on: 1.46
Version with regression
rustc --version --verbose
:
rustc 1.47.0 (18bf6b4f0 2020-10-07)
binary: rustc
commit-hash: 18bf6b4f01a6feaf7259ba7cdae58031af1b7b39
commit-date: 2020-10-07
host: x86_64-unknown-linux-gnu
release: 1.47.0
LLVM version: 11.0
@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged