diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2018-04-25 14:51:06 -0700 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2018-04-25 14:55:25 -0700 |
| commit | 4e2cd4104a39c1e0562c3fb00085a1a3f4f22291 (patch) | |
| tree | 3aabdc094914974ed92e6dfba6747d17b1323e0a /src/librustc_errors | |
| parent | b9c44ebd3f3048ff3630868d15051eb00086637a (diff) | |
| download | rust-4e2cd4104a39c1e0562c3fb00085a1a3f4f22291.tar.gz rust-4e2cd4104a39c1e0562c3fb00085a1a3f4f22291.zip | |
Approximate -> Applicability
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/diagnostic.rs | 20 | ||||
| -rw-r--r-- | src/librustc_errors/diagnostic_builder.rs | 10 | ||||
| -rw-r--r-- | src/librustc_errors/lib.rs | 4 |
3 files changed, 17 insertions, 17 deletions
diff --git a/src/librustc_errors/diagnostic.rs b/src/librustc_errors/diagnostic.rs index bfeb351f1a4..75401f21862 100644 --- a/src/librustc_errors/diagnostic.rs +++ b/src/librustc_errors/diagnostic.rs @@ -11,7 +11,7 @@ use CodeSuggestion; use SubstitutionPart; use Substitution; -use SuggestionApproximate; +use Applicability; use Level; use std::fmt; use syntax_pos::{MultiSpan, Span}; @@ -223,7 +223,7 @@ impl Diagnostic { }], msg: msg.to_owned(), show_code_when_inline: false, - approximate: SuggestionApproximate::Unspecified, + applicability: Applicability::Unspecified, }); self } @@ -254,7 +254,7 @@ impl Diagnostic { }], msg: msg.to_owned(), show_code_when_inline: true, - approximate: SuggestionApproximate::Unspecified, + applicability: Applicability::Unspecified, }); self } @@ -270,16 +270,16 @@ impl Diagnostic { }).collect(), msg: msg.to_owned(), show_code_when_inline: true, - approximate: SuggestionApproximate::Unspecified, + applicability: Applicability::Unspecified, }); self } /// This is a suggestion that may contain mistakes or fillers and should /// be read and understood by a human. - pub fn span_approximate_suggestion(&mut self, sp: Span, msg: &str, + pub fn span_suggestion_with_applicability(&mut self, sp: Span, msg: &str, suggestion: String, - approximate: SuggestionApproximate) -> &mut Self { + applicability: Applicability) -> &mut Self { self.suggestions.push(CodeSuggestion { substitutions: vec![Substitution { parts: vec![SubstitutionPart { @@ -289,14 +289,14 @@ impl Diagnostic { }], msg: msg.to_owned(), show_code_when_inline: true, - approximate, + applicability, }); self } - pub fn span_approximate_suggestions(&mut self, sp: Span, msg: &str, + pub fn span_suggestions_with_applicability(&mut self, sp: Span, msg: &str, suggestions: Vec<String>, - approximate: SuggestionApproximate) -> &mut Self { + applicability: Applicability) -> &mut Self { self.suggestions.push(CodeSuggestion { substitutions: suggestions.into_iter().map(|snippet| Substitution { parts: vec![SubstitutionPart { @@ -306,7 +306,7 @@ impl Diagnostic { }).collect(), msg: msg.to_owned(), show_code_when_inline: true, - approximate, + applicability, }); self } diff --git a/src/librustc_errors/diagnostic_builder.rs b/src/librustc_errors/diagnostic_builder.rs index 31eacb527ee..7e9ca8633a5 100644 --- a/src/librustc_errors/diagnostic_builder.rs +++ b/src/librustc_errors/diagnostic_builder.rs @@ -11,7 +11,7 @@ use Diagnostic; use DiagnosticId; use DiagnosticStyledString; -use SuggestionApproximate; +use Applicability; use Level; use Handler; @@ -188,17 +188,17 @@ impl<'a> DiagnosticBuilder<'a> { msg: &str, suggestions: Vec<String>) -> &mut Self); - forward!(pub fn span_approximate_suggestion(&mut self, + forward!(pub fn span_suggestion_with_applicability(&mut self, sp: Span, msg: &str, suggestion: String, - approximate: SuggestionApproximate) + applicability: Applicability) -> &mut Self); - forward!(pub fn span_approximate_suggestions(&mut self, + forward!(pub fn span_suggestions_with_applicability(&mut self, sp: Span, msg: &str, suggestions: Vec<String>, - approximate: SuggestionApproximate) + applicability: Applicability) -> &mut Self); forward!(pub fn set_span<S: Into<MultiSpan>>(&mut self, sp: S) -> &mut Self); forward!(pub fn code(&mut self, s: DiagnosticId) -> &mut Self); diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 9abb5b38c05..c2b442e9497 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -57,7 +57,7 @@ mod lock; use syntax_pos::{BytePos, Loc, FileLinesResult, FileMap, FileName, MultiSpan, Span, NO_EXPANSION}; #[derive(Copy, Clone, Debug, PartialEq, Hash, RustcEncodable, RustcDecodable)] -pub enum SuggestionApproximate { +pub enum Applicability { MachineApplicable, HasPlaceholders, MaybeIncorrect, @@ -95,7 +95,7 @@ pub struct CodeSuggestion { /// Sometimes we may show suggestions with placeholders, /// which are useful for users but not useful for /// tools like rustfix - pub approximate: SuggestionApproximate, + pub applicability: Applicability, } #[derive(Clone, Debug, PartialEq, Hash, RustcEncodable, RustcDecodable)] |
