about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-07-26 09:11:18 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-07-26 09:11:18 +1000
commit39d51bd51c941021567e6adae1f80c3cbcc31d47 (patch)
tree2daf23e6f50a61a9b33178aa621457b7121c9730 /compiler/rustc_parse/src
parent8771282d4e7a5c4569e49d1f878fb3ba90a974d0 (diff)
downloadrust-39d51bd51c941021567e6adae1f80c3cbcc31d47.tar.gz
rust-39d51bd51c941021567e6adae1f80c3cbcc31d47.zip
Remove `Parser::desugar_doc_comments`.
It's currently stored twice: once in `Parser`, once in the `TokenStream`
within `Parser`. We only need the latter.
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 2e1a61e634e..843e1e4d157 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -138,7 +138,6 @@ pub struct Parser<'a> {
     // Important: This must only be advanced from `bump` to ensure that
     // `token_cursor.num_next_calls` is updated properly.
     token_cursor: TokenCursor,
-    desugar_doc_comments: bool,
     /// This field is used to keep track of how many left angle brackets we have seen. This is
     /// required in order to detect extra leading left angle brackets (`<` characters) and error
     /// appropriately.
@@ -463,7 +462,6 @@ impl<'a> Parser<'a> {
                 desugar_doc_comments,
                 break_last_token: false,
             },
-            desugar_doc_comments,
             unmatched_angle_bracket_count: 0,
             max_angle_bracket_count: 0,
             last_unexpected_token_span: None,
@@ -1107,7 +1105,7 @@ impl<'a> Parser<'a> {
     pub fn bump(&mut self) {
         // Note: destructuring here would give nicer code, but it was found in #96210 to be slower
         // than `.0`/`.1` access.
-        let mut next = self.token_cursor.inlined_next(self.desugar_doc_comments);
+        let mut next = self.token_cursor.inlined_next(self.token_cursor.desugar_doc_comments);
         self.token_cursor.num_next_calls += 1;
         // We've retrieved an token from the underlying
         // cursor, so we no longer need to worry about