From b5f94c61f72cc85151dbd9bb1081fde2ab78f806 Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Thu, 11 Jul 2024 22:03:08 +0000 Subject: Use more accurate span for `:` to `::` suggestion --- compiler/rustc_parse/src/parser/path.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compiler/rustc_parse/src/parser') diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs index 03c647dd527..b9014dea726 100644 --- a/compiler/rustc_parse/src/parser/path.rs +++ b/compiler/rustc_parse/src/parser/path.rs @@ -258,6 +258,7 @@ impl<'a> Parser<'a> { self.bump(); // bump past the colon self.dcx().emit_err(PathSingleColon { span: self.prev_token.span, + suggestion: self.prev_token.span.shrink_to_hi(), type_ascription: self .psess .unstable_features @@ -329,6 +330,7 @@ impl<'a> Parser<'a> { err.cancel(); err = self.dcx().create_err(PathSingleColon { span: self.token.span, + suggestion: self.prev_token.span.shrink_to_hi(), type_ascription: self .psess .unstable_features -- cgit 1.4.1-3-g733a5