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
This commit is contained in:
Esteban Küber 2020-07-09 13:49:55 -07:00
parent 6b09c37ddc
commit 6ed06b2ba9
28 changed files with 212 additions and 181 deletions

View file

@ -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,