Skip to content

Commit 9167eea

Browse files
committed
Use interpolated_or_expr_span in one suitable place.
1 parent dee6c92 commit 9167eea

File tree

1 file changed

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

1 file changed

+1
-7
lines changed

compiler/rustc_parse/src/parser/expr.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,7 @@ impl<'a> Parser<'a> {
193193

194194
self.expected_tokens.push(TokenType::Operator);
195195
while let Some(op) = self.check_assoc_op() {
196-
// Adjust the span for interpolated LHS to point to the `$lhs` token
197-
// and not to what it refers to.
198-
let lhs_span = match self.prev_token.kind {
199-
TokenKind::Interpolated(..) => self.prev_token.span,
200-
_ => lhs.span,
201-
};
202-
196+
let lhs_span = self.interpolated_or_expr_span(&lhs);
203197
let cur_op_span = self.token.span;
204198
let restrictions = if op.node.is_assign_like() {
205199
self.restrictions & Restrictions::NO_STRUCT_LITERAL

0 commit comments

Comments
 (0)