about summary refs log tree commit diff
path: root/src/librustc_session
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_session
parent6b09c37ddc240e25748e53d7a8f81f252def6dee (diff)
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_session')
-rw-r--r--src/librustc_session/parse.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc_session/parse.rs b/src/librustc_session/parse.rs
index b428315b3cd..1b232d7b14d 100644
--- a/src/librustc_session/parse.rs
+++ b/src/librustc_session/parse.rs
@@ -138,6 +138,8 @@ pub struct ParseSess {
     pub reached_eof: Lock<bool>,
     /// Environment variables accessed during the build and their values when they exist.
     pub env_depinfo: Lock<FxHashSet<(Symbol, Option<Symbol>)>>,
+    /// All the type ascriptions expressions that have had a suggestion for likely path typo.
+    pub type_ascription_path_suggestions: Lock<FxHashSet<Span>>,
 }
 
 impl ParseSess {
@@ -164,6 +166,7 @@ impl ParseSess {
             symbol_gallery: SymbolGallery::default(),
             reached_eof: Lock::new(false),
             env_depinfo: Default::default(),
+            type_ascription_path_suggestions: Default::default(),
         }
     }