about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorclubby789 <jamie@hill-daniel.co.uk>2023-01-29 13:37:05 +0000
committerclubby789 <jamie@hill-daniel.co.uk>2023-02-06 14:40:35 +0000
commit521c5f36d69b9056c0147502d12426fbd9b6c9c4 (patch)
treed5424bdff9591b5e7ff449e5d6a06ac5cd8ae060 /compiler/rustc_parse/src/parser/expr.rs
parente7813fee92c56621d08e8dbe83948d9f4a30a9ec (diff)
downloadrust-521c5f36d69b9056c0147502d12426fbd9b6c9c4.tar.gz
rust-521c5f36d69b9056c0147502d12426fbd9b6c9c4.zip
Migrate `rustc_parse` to derive diagnostics
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index c37808f8c3d..2fc8ce98af0 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -5,6 +5,7 @@ use super::{
     AttrWrapper, BlockMode, ClosureSpans, ForceCollect, Parser, PathStyle, Restrictions,
     SemiColonMode, SeqSep, TokenExpectType, TokenType, TrailingToken,
 };
+
 use crate::errors;
 use crate::maybe_recover_from_interpolated_ty_qpath;
 use core::mem;
@@ -1017,7 +1018,7 @@ impl<'a> Parser<'a> {
     fn error_unexpected_after_dot(&self) {
         // FIXME Could factor this out into non_fatal_unexpected or something.
         let actual = pprust::token_to_string(&self.token);
-        self.struct_span_err(self.token.span, &format!("unexpected token: `{actual}`")).emit();
+        self.sess.emit_err(errors::UnexpectedTokenAfterDot { span: self.token.span, actual });
     }
 
     // We need an identifier or integer, but the next token is a float.