We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
maybe_whole!
parse_stmt_without_recovery
1 parent 1f958e8 commit 6f112beCopy full SHA for 6f112be
compiler/rustc_parse/src/parser/stmt.rs
@@ -51,18 +51,12 @@ impl<'a> Parser<'a> {
51
let attrs = self.parse_outer_attributes()?;
52
let lo = self.token.span;
53
54
- // Don't use `maybe_whole` so that we have precise control
55
- // over when we bump the parser
56
- if let token::Interpolated(nt) = &self.token.kind
57
- && let token::NtStmt(stmt) = &nt.0
58
- {
59
- let mut stmt = stmt.clone();
60
- self.bump();
+ maybe_whole!(self, NtStmt, |mut stmt| {
61
stmt.visit_attrs(|stmt_attrs| {
62
attrs.prepend_to_nt_inner(stmt_attrs);
63
});
64
- return Ok(Some(stmt.into_inner()));
65
- }
+ Some(stmt.into_inner())
+ });
66
67
if self.token.is_keyword(kw::Mut) && self.is_keyword_ahead(1, &[kw::Let]) {
68
self.bump();
0 commit comments