Skip to content

Commit 39d51bd

Browse files
committed
Remove Parser::desugar_doc_comments.
It's currently stored twice: once in `Parser`, once in the `TokenStream` within `Parser`. We only need the latter.
1 parent 8771282 commit 39d51bd

File tree

1 file changed

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

1 file changed

+1
-3
lines changed

compiler/rustc_parse/src/parser/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ pub struct Parser<'a> {
138138
// Important: This must only be advanced from `bump` to ensure that
139139
// `token_cursor.num_next_calls` is updated properly.
140140
token_cursor: TokenCursor,
141-
desugar_doc_comments: bool,
142141
/// This field is used to keep track of how many left angle brackets we have seen. This is
143142
/// required in order to detect extra leading left angle brackets (`<` characters) and error
144143
/// appropriately.
@@ -463,7 +462,6 @@ impl<'a> Parser<'a> {
463462
desugar_doc_comments,
464463
break_last_token: false,
465464
},
466-
desugar_doc_comments,
467465
unmatched_angle_bracket_count: 0,
468466
max_angle_bracket_count: 0,
469467
last_unexpected_token_span: None,
@@ -1107,7 +1105,7 @@ impl<'a> Parser<'a> {
11071105
pub fn bump(&mut self) {
11081106
// Note: destructuring here would give nicer code, but it was found in #96210 to be slower
11091107
// than `.0`/`.1` access.
1110-
let mut next = self.token_cursor.inlined_next(self.desugar_doc_comments);
1108+
let mut next = self.token_cursor.inlined_next(self.token_cursor.desugar_doc_comments);
11111109
self.token_cursor.num_next_calls += 1;
11121110
// We've retrieved an token from the underlying
11131111
// cursor, so we no longer need to worry about

0 commit comments

Comments
 (0)