diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2018-04-24 15:42:27 -0700 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2018-04-24 15:42:27 -0700 |
| commit | b9c44ebd3f3048ff3630868d15051eb00086637a (patch) | |
| tree | 7cdc169d440532f08d5f154a59d05bdc7709639f /src/libsyntax | |
| parent | f5203d1073a774e01ae0c57ebb561648a8fd9910 (diff) | |
| download | rust-b9c44ebd3f3048ff3630868d15051eb00086637a.tar.gz rust-b9c44ebd3f3048ff3630868d15051eb00086637a.zip | |
Use enum for approximate suggestions
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/json.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libsyntax/json.rs b/src/libsyntax/json.rs index b4f34fb12e3..dd77e441499 100644 --- a/src/libsyntax/json.rs +++ b/src/libsyntax/json.rs @@ -23,7 +23,7 @@ use codemap::{CodeMap, FilePathMapping}; use syntax_pos::{self, MacroBacktrace, Span, SpanLabel, MultiSpan}; use errors::registry::Registry; use errors::{DiagnosticBuilder, SubDiagnostic, CodeSuggestion, CodeMapper}; -use errors::DiagnosticId; +use errors::{DiagnosticId, SuggestionApproximate}; use errors::emitter::{Emitter, EmitterWriter}; use rustc_data_structures::sync::{self, Lrc}; @@ -138,7 +138,7 @@ struct DiagnosticSpan { suggested_replacement: Option<String>, /// If the suggestion is approximate #[rustc_serialize_exclude_null] - suggestion_approximate: Option<bool>, + suggestion_approximate: Option<SuggestionApproximate>, /// Macro invocations that created the code at this span, if any. expansion: Option<Box<DiagnosticSpanMacroExpansion>>, } @@ -239,7 +239,7 @@ impl Diagnostic { impl DiagnosticSpan { fn from_span_label(span: SpanLabel, - suggestion: Option<(&String, bool)>, + suggestion: Option<(&String, SuggestionApproximate)>, je: &JsonEmitter) -> DiagnosticSpan { Self::from_span_etc(span.span, @@ -252,7 +252,7 @@ impl DiagnosticSpan { fn from_span_etc(span: Span, is_primary: bool, label: Option<String>, - suggestion: Option<(&String, bool)>, + suggestion: Option<(&String, SuggestionApproximate)>, je: &JsonEmitter) -> DiagnosticSpan { // obtain the full backtrace from the `macro_backtrace` @@ -272,7 +272,7 @@ impl DiagnosticSpan { fn from_span_full(span: Span, is_primary: bool, label: Option<String>, - suggestion: Option<(&String, bool)>, + suggestion: Option<(&String, SuggestionApproximate)>, mut backtrace: vec::IntoIter<MacroBacktrace>, je: &JsonEmitter) -> DiagnosticSpan { |
