about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-12-14 10:31:06 +0100
committerGitHub <noreply@github.com>2022-12-14 10:31:06 +0100
commitc8fd654d7ce2ab5a4945cead8a947f923b98f5a5 (patch)
treebc61d05f88a02a97fd297f69a88afe01deb23644 /compiler/rustc_parse/src/errors.rs
parent49b99078b0ea08e37ed006e10f3e0705c63c4560 (diff)
parentb70a869d8f49e87d8432de6af6d209243a7053a4 (diff)
downloadrust-c8fd654d7ce2ab5a4945cead8a947f923b98f5a5.tar.gz
rust-c8fd654d7ce2ab5a4945cead8a947f923b98f5a5.zip
Rollup merge of #105502 - chenyukang:yukang/fix-105366-impl, r=estebank
Suggest impl in the scenario of typo with fn

Fixes #105366
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
-rw-r--r--compiler/rustc_parse/src/errors.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs
index 9875cde4a05..18a0bee9c2e 100644
--- a/compiler/rustc_parse/src/errors.rs
+++ b/compiler/rustc_parse/src/errors.rs
@@ -1221,3 +1221,11 @@ pub(crate) struct UnexpectedIfWithIf(
     #[suggestion(applicability = "machine-applicable", code = " ", style = "verbose")]
     pub Span,
 );
+
+#[derive(Diagnostic)]
+#[diag(parse_maybe_fn_typo_with_impl)]
+pub(crate) struct FnTypoWithImpl {
+    #[primary_span]
+    #[suggestion(applicability = "maybe-incorrect", code = "impl", style = "verbose")]
+    pub fn_span: Span,
+}