From b9c44ebd3f3048ff3630868d15051eb00086637a Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Tue, 24 Apr 2018 15:42:27 -0700 Subject: Use enum for approximate suggestions --- src/libsyntax/json.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libsyntax') 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, /// If the suggestion is approximate #[rustc_serialize_exclude_null] - suggestion_approximate: Option, + suggestion_approximate: Option, /// Macro invocations that created the code at this span, if any. expansion: Option>, } @@ -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, - 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, - suggestion: Option<(&String, bool)>, + suggestion: Option<(&String, SuggestionApproximate)>, mut backtrace: vec::IntoIter, je: &JsonEmitter) -> DiagnosticSpan { -- cgit 1.4.1-3-g733a5