about summary refs log tree commit diff
path: root/src/librustc_parse/parser
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2020-07-09 13:49:55 -0700
committerEsteban Küber <esteban@kuber.com.ar>2020-07-31 11:29:15 -0700
commit6ed06b2ba9515387957959db83dab99addbd855d (patch)
tree36c989b465f5ea47ab01f4caea213c9b91821422 /src/librustc_parse/parser
parent6b09c37ddc240e25748e53d7a8f81f252def6dee (diff)
downloadrust-6ed06b2ba9515387957959db83dab99addbd855d.tar.gz
rust-6ed06b2ba9515387957959db83dab99addbd855d.zip
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
Diffstat (limited to 'src/librustc_parse/parser')
-rw-r--r--src/librustc_parse/parser/diagnostics.rs1
1 files changed, 1 insertions, 0 deletions
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,