about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/mod.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-07-26 09:22:59 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-07-26 13:38:56 +1000
commit34b218e4548f9a989a4131979a61d15fd73289e9 (patch)
treef0ac83b10b6b4cd7250294c7e08f1a2eb458449e /compiler/rustc_parse/src/parser/mod.rs
parent8bfc69285146bdfa97ea38bb9bcd5c8a92c1de47 (diff)
downloadrust-34b218e4548f9a989a4131979a61d15fd73289e9.tar.gz
rust-34b218e4548f9a989a4131979a61d15fd73289e9.zip
Add a comment to `TokenCursor::desugar_doc_comments`.
Useful information that took me some time to discern.
Diffstat (limited to 'compiler/rustc_parse/src/parser/mod.rs')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 1715d9f6cc4..37b4c371c94 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -224,6 +224,9 @@ struct TokenCursor {
     // because it's the outermost token stream which never has delimiters.
     stack: Vec<(TokenTreeCursor, Delimiter, DelimSpan)>,
 
+    // We need to desugar doc comments from `/// foo` form into `#[doc =
+    // r"foo"]` form when parsing declarative macro inputs in `parse_tt`,
+    // because some declarative macros look for `doc` attributes.
     desugar_doc_comments: bool,
 
     // Counts the number of calls to `{,inlined_}next`.