From aff403cf689e30fdd20b96333d3a10db92086e4f Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Tue, 27 Dec 2022 06:14:40 +0000 Subject: Recover `fn` keyword as `Fn` trait in bounds --- compiler/rustc_parse/src/errors.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'compiler/rustc_parse/src/errors.rs') diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index 18a0bee9c2e..574591529f3 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -1229,3 +1229,11 @@ pub(crate) struct FnTypoWithImpl { #[suggestion(applicability = "maybe-incorrect", code = "impl", style = "verbose")] pub fn_span: Span, } + +#[derive(Diagnostic)] +#[diag(parse_expected_fn_path_found_fn_keyword)] +pub(crate) struct ExpectedFnPathFoundFnKeyword { + #[primary_span] + #[suggestion(applicability = "machine-applicable", code = "Fn", style = "verbose")] + pub fn_token_span: Span, +} -- cgit 1.4.1-3-g733a5