diff options
| author | bors <bors@rust-lang.org> | 2024-05-14 01:10:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-05-14 01:10:38 +0000 |
| commit | 9105c57b7f6623310e33f3ee7e48a3114e5190a7 (patch) | |
| tree | 39ab5ec24ca4022eaa170ee8477dac0b40758dee /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 34582118afaf00b0eb2d209a90b181c7156b501c (diff) | |
| parent | 95e519ecbf343c5246b2777b64d223fcd0f68b4c (diff) | |
| download | rust-9105c57b7f6623310e33f3ee7e48a3114e5190a7.tar.gz rust-9105c57b7f6623310e33f3ee7e48a3114e5190a7.zip | |
Auto merge of #124256 - nnethercote:rm-NtIdent-NtLifetime, r=petrochenkov
Remove `NtIdent` and `NtLifetime` This is one part of the bigger "remove `Nonterminal` and `TokenKind::Interpolated`" change drafted in #114647. More details in the individual commit messages. r? `@petrochenkov`
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 441aa5b0806..cbc7ce9ef7c 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -45,7 +45,7 @@ use thin_vec::{thin_vec, ThinVec}; macro_rules! maybe_whole_expr { ($p:expr) => { if let token::Interpolated(nt) = &$p.token.kind { - match &nt.0 { + match &**nt { token::NtExpr(e) | token::NtLiteral(e) => { let e = e.clone(); $p.bump(); @@ -724,7 +724,9 @@ impl<'a> Parser<'a> { /// Returns the span of expr if it was not interpolated, or the span of the interpolated token. fn interpolated_or_expr_span(&self, expr: &Expr) -> Span { match self.prev_token.kind { - TokenKind::Interpolated(..) => self.prev_token.span, + TokenKind::NtIdent(..) | TokenKind::NtLifetime(..) | TokenKind::Interpolated(..) => { + self.prev_token.span + } _ => expr.span, } } |
