breaking change on stable: handling of block doc comments #83982
Labels
A-proc-macros
Area: Procedural macros
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone
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:
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
:@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged
The text was updated successfully, but these errors were encountered: