about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-02-09 11:21:57 +0100
committerGitHub <noreply@github.com>2023-02-09 11:21:57 +0100
commit3b9543c89d1909bae143bfe9a87d3248d1526cf2 (patch)
tree065f57ac29c6a373eaa0f9092c5fe1d64d35c263 /compiler/rustc_parse/src/parser/expr.rs
parentc40919b7a75f93ed7ef040361e82c656d246d41e (diff)
parent521c5f36d69b9056c0147502d12426fbd9b6c9c4 (diff)
downloadrust-3b9543c89d1909bae143bfe9a87d3248d1526cf2.tar.gz
rust-3b9543c89d1909bae143bfe9a87d3248d1526cf2.zip
Rollup merge of #107446 - clubby789:rustc-parse-diag-migrate, r=compiler-errors
Migrate some of `rustc_parse` to derive diagnostics

`@rustbot` label +A-translation
r? rust-lang/diagnostics
cc #100717
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.