From e90e2593ea9c29ff6be20ec38b314fb2d6d927a4 Mon Sep 17 00:00:00 2001 From: Pavel Grigorenko Date: Sat, 21 Sep 2024 20:07:52 +0300 Subject: Parser: recover from `:::` to `::` --- compiler/rustc_parse/src/errors.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (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 e3e7fcebaaa..e9fe2e6c1dd 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -1571,7 +1571,7 @@ pub(crate) struct ExpectedFnPathFoundFnKeyword { } #[derive(Diagnostic)] -#[diag(parse_path_single_colon)] +#[diag(parse_path_double_colon)] pub(crate) struct PathSingleColon { #[primary_span] pub span: Span, @@ -1583,6 +1583,14 @@ pub(crate) struct PathSingleColon { pub type_ascription: bool, } +#[derive(Diagnostic)] +#[diag(parse_path_double_colon)] +pub(crate) struct PathTripleColon { + #[primary_span] + #[suggestion(applicability = "maybe-incorrect", code = "", style = "verbose")] + pub span: Span, +} + #[derive(Diagnostic)] #[diag(parse_colon_as_semi)] pub(crate) struct ColonAsSemi { -- cgit 1.4.1-3-g733a5