diff options
| author | bors <bors@rust-lang.org> | 2023-08-04 05:44:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-08-04 05:44:54 +0000 |
| commit | 15c05fe25f48ddd2ee0efdc1ac9d24af473769b4 (patch) | |
| tree | 150c1c2779d9b093507486e92ac3ea013bc6409b /compiler/rustc_parse/src/parser/attr.rs | |
| parent | f8d75a481392b59b979350d441eed2329e68e808 (diff) | |
| parent | 1a803a0c790ade534dec44c17816eb389d7dd8ed (diff) | |
| download | rust-15c05fe25f48ddd2ee0efdc1ac9d24af473769b4.tar.gz rust-15c05fe25f48ddd2ee0efdc1ac9d24af473769b4.zip | |
Auto merge of #3012 - rust-lang:rustup-2023-08-04, r=oli-obk
Automatic sync from rustc
Diffstat (limited to 'compiler/rustc_parse/src/parser/attr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/attr.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/attr.rs b/compiler/rustc_parse/src/parser/attr.rs index ee0abba1c17..104de47b97d 100644 --- a/compiler/rustc_parse/src/parser/attr.rs +++ b/compiler/rustc_parse/src/parser/attr.rs @@ -36,7 +36,7 @@ impl<'a> Parser<'a> { pub(super) fn parse_outer_attributes(&mut self) -> PResult<'a, AttrWrapper> { let mut outer_attrs = ast::AttrVec::new(); let mut just_parsed_doc_comment = false; - let start_pos = self.token_cursor.num_next_calls; + let start_pos = self.num_bump_calls; loop { let attr = if self.check(&token::Pound) { let prev_outer_attr_sp = outer_attrs.last().map(|attr| attr.span); @@ -277,7 +277,7 @@ impl<'a> Parser<'a> { pub(crate) fn parse_inner_attributes(&mut self) -> PResult<'a, ast::AttrVec> { let mut attrs = ast::AttrVec::new(); loop { - let start_pos: u32 = self.token_cursor.num_next_calls.try_into().unwrap(); + let start_pos: u32 = self.num_bump_calls.try_into().unwrap(); // Only try to parse if it is an inner attribute (has `!`). let attr = if self.check(&token::Pound) && self.look_ahead(1, |t| t == &token::Not) { Some(self.parse_attribute(InnerAttrPolicy::Permitted)?) @@ -298,7 +298,7 @@ impl<'a> Parser<'a> { None }; if let Some(attr) = attr { - let end_pos: u32 = self.token_cursor.num_next_calls.try_into().unwrap(); + let end_pos: u32 = self.num_bump_calls.try_into().unwrap(); // If we are currently capturing tokens, mark the location of this inner attribute. // If capturing ends up creating a `LazyAttrTokenStream`, we will include // this replace range with it, removing the inner attribute from the final |
