File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
compiler/rustc_parse/src/parser Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff 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
@@ -702,7 +696,8 @@ impl<'a> Parser<'a> {
702696 self . parse_expr_unary ( lo, UnOp :: Not )
703697 }
704698
705- /// Returns the span of expr, if it was not interpolated or the span of the interpolated token.
699+ /// Returns the span of `expr` if it was not interpolated, or the span of the interpolated
700+ /// token.
706701 fn interpolated_or_expr_span ( & self , expr : & Expr ) -> Span {
707702 match self . prev_token . kind {
708703 TokenKind :: Interpolated ( ..) => self . prev_token . span ,
You can’t perform that action at this time.
0 commit comments