diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2018-05-06 13:30:06 -0700 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2018-05-21 10:48:12 -0700 |
| commit | 30bd586bec5efb8317a6fdf6ce53b64fac567270 (patch) | |
| tree | bfc2249547e1d47a203d7c2056ad68355cbb6079 /src/libsyntax | |
| parent | 6e6a4b1957e2407563f3c9005504f95138ffe28f (diff) | |
| download | rust-30bd586bec5efb8317a6fdf6ce53b64fac567270.tar.gz rust-30bd586bec5efb8317a6fdf6ce53b64fac567270.zip | |
Stabilize suggestion applicability field in json output
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/json.rs | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/libsyntax/json.rs b/src/libsyntax/json.rs index 2f15e75093b..f129aea32b8 100644 --- a/src/libsyntax/json.rs +++ b/src/libsyntax/json.rs @@ -38,22 +38,18 @@ pub struct JsonEmitter { registry: Option<Registry>, cm: Lrc<CodeMapper + sync::Send + sync::Sync>, pretty: bool, - /// Whether "approximate suggestions" are enabled in the config - suggestion_applicability: bool, ui_testing: bool, } impl JsonEmitter { pub fn stderr(registry: Option<Registry>, code_map: Lrc<CodeMap>, - pretty: bool, - suggestion_applicability: bool) -> JsonEmitter { + pretty: bool) -> JsonEmitter { JsonEmitter { dst: Box::new(io::stderr()), registry, cm: code_map, pretty, - suggestion_applicability, ui_testing: false, } } @@ -61,20 +57,18 @@ impl JsonEmitter { pub fn basic(pretty: bool) -> JsonEmitter { let file_path_mapping = FilePathMapping::empty(); JsonEmitter::stderr(None, Lrc::new(CodeMap::new(file_path_mapping)), - pretty, false) + pretty) } pub fn new(dst: Box<Write + Send>, registry: Option<Registry>, code_map: Lrc<CodeMap>, - pretty: bool, - suggestion_applicability: bool) -> JsonEmitter { + pretty: bool) -> JsonEmitter { JsonEmitter { dst, registry, cm: code_map, pretty, - suggestion_applicability, ui_testing: false, } } @@ -137,7 +131,6 @@ struct DiagnosticSpan { /// that should be sliced in atop this span. suggested_replacement: Option<String>, /// If the suggestion is approximate - #[rustc_serialize_exclude_null] suggestion_applicability: Option<Applicability>, /// Macro invocations that created the code at this span, if any. expansion: Option<Box<DiagnosticSpanMacroExpansion>>, @@ -301,12 +294,6 @@ impl DiagnosticSpan { }) }); - let suggestion_applicability = if je.suggestion_applicability { - suggestion.map(|x| x.1) - } else { - None - }; - DiagnosticSpan { file_name: start.file.name.to_string(), byte_start: span.lo().0 - start.file.start_pos.0, @@ -318,7 +305,7 @@ impl DiagnosticSpan { is_primary, text: DiagnosticSpanLine::from_span(span, je), suggested_replacement: suggestion.map(|x| x.0.clone()), - suggestion_applicability, + suggestion_applicability: suggestion.map(|x| x.1), expansion: backtrace_step, label, } |
