Skip to content

Commit 34b218e

Browse files
committed
Add a comment to TokenCursor::desugar_doc_comments.
Useful information that took me some time to discern.
1 parent 8bfc692 commit 34b218e

File tree

1 file changed

+3
-0
lines changed
  • compiler/rustc_parse/src/parser

1 file changed

+3
-0
lines changed

compiler/rustc_parse/src/parser/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ struct TokenCursor {
224224
// because it's the outermost token stream which never has delimiters.
225225
stack: Vec<(TokenTreeCursor, Delimiter, DelimSpan)>,
226226

227+
// We need to desugar doc comments from `/// foo` form into `#[doc =
228+
// r"foo"]` form when parsing declarative macro inputs in `parse_tt`,
229+
// because some declarative macros look for `doc` attributes.
227230
desugar_doc_comments: bool,
228231

229232
// Counts the number of calls to `{,inlined_}next`.

0 commit comments

Comments
 (0)