From 6ed06b2ba9515387957959db83dab99addbd855d Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Thu, 9 Jul 2020 13:49:55 -0700 Subject: Reduce verbosity of some type ascription errors * Deduplicate type ascription LHS errors * Remove duplicated `:` -> `::` suggestion from parse error * Tweak wording to be more accurate * Modify `current_type_ascription` to reduce span wrangling * remove now unnecessary match arm * Add run-rustfix to appropriate tests --- src/librustc_parse/parser/diagnostics.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/librustc_parse/parser') diff --git a/src/librustc_parse/parser/diagnostics.rs b/src/librustc_parse/parser/diagnostics.rs index 609a0c961e9..5e9411327ca 100644 --- a/src/librustc_parse/parser/diagnostics.rs +++ b/src/librustc_parse/parser/diagnostics.rs @@ -333,6 +333,7 @@ impl<'a> Parser<'a> { Applicability::MachineApplicable }, ); + self.sess.type_ascription_path_suggestions.borrow_mut().insert(sp); } else if op_pos.line != next_pos.line && maybe_expected_semicolon { err.span_suggestion( sp, -- cgit 1.4.1-3-g733a5