about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-08-15 10:35:42 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-08-18 16:50:41 +1000
commit9167eea553d00a790c10ebc0a821e3fa1b13d93c (patch)
treefb4debe9b11b594c529f85a904a4ebffc892e27b /compiler/rustc_parse/src/parser/expr.rs
parentdee6c9241f7402b5122266f8f59f6b731678b50a (diff)
downloadrust-9167eea553d00a790c10ebc0a821e3fa1b13d93c.tar.gz
rust-9167eea553d00a790c10ebc0a821e3fa1b13d93c.zip
Use `interpolated_or_expr_span` in one suitable place.
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index d17f2f0261b..e308e5b3420 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -193,13 +193,7 @@ impl<'a> Parser<'a> {
 
         self.expected_tokens.push(TokenType::Operator);
         while let Some(op) = self.check_assoc_op() {
-            // Adjust the span for interpolated LHS to point to the `$lhs` token
-            // and not to what it refers to.
-            let lhs_span = match self.prev_token.kind {
-                TokenKind::Interpolated(..) => self.prev_token.span,
-                _ => lhs.span,
-            };
-
+            let lhs_span = self.interpolated_or_expr_span(&lhs);
             let cur_op_span = self.token.span;
             let restrictions = if op.node.is_assign_like() {
                 self.restrictions & Restrictions::NO_STRUCT_LITERAL