@@ -38,43 +38,37 @@ pub struct JsonEmitter {
3838 registry : Option < Registry > ,
3939 cm : Lrc < CodeMapper + sync:: Send + sync:: Sync > ,
4040 pretty : bool ,
41- /// Whether "approximate suggestions" are enabled in the config
42- suggestion_applicability : bool ,
4341 ui_testing : bool ,
4442}
4543
4644impl JsonEmitter {
4745 pub fn stderr ( registry : Option < Registry > ,
4846 code_map : Lrc < CodeMap > ,
49- pretty : bool ,
50- suggestion_applicability : bool ) -> JsonEmitter {
47+ pretty : bool ) -> JsonEmitter {
5148 JsonEmitter {
5249 dst : Box :: new ( io:: stderr ( ) ) ,
5350 registry,
5451 cm : code_map,
5552 pretty,
56- suggestion_applicability,
5753 ui_testing : false ,
5854 }
5955 }
6056
6157 pub fn basic ( pretty : bool ) -> JsonEmitter {
6258 let file_path_mapping = FilePathMapping :: empty ( ) ;
6359 JsonEmitter :: stderr ( None , Lrc :: new ( CodeMap :: new ( file_path_mapping) ) ,
64- pretty, false )
60+ pretty)
6561 }
6662
6763 pub fn new ( dst : Box < Write + Send > ,
6864 registry : Option < Registry > ,
6965 code_map : Lrc < CodeMap > ,
70- pretty : bool ,
71- suggestion_applicability : bool ) -> JsonEmitter {
66+ pretty : bool ) -> JsonEmitter {
7267 JsonEmitter {
7368 dst,
7469 registry,
7570 cm : code_map,
7671 pretty,
77- suggestion_applicability,
7872 ui_testing : false ,
7973 }
8074 }
@@ -137,7 +131,6 @@ struct DiagnosticSpan {
137131 /// that should be sliced in atop this span.
138132 suggested_replacement : Option < String > ,
139133 /// If the suggestion is approximate
140- #[ rustc_serialize_exclude_null]
141134 suggestion_applicability : Option < Applicability > ,
142135 /// Macro invocations that created the code at this span, if any.
143136 expansion : Option < Box < DiagnosticSpanMacroExpansion > > ,
@@ -301,12 +294,6 @@ impl DiagnosticSpan {
301294 } )
302295 } ) ;
303296
304- let suggestion_applicability = if je. suggestion_applicability {
305- suggestion. map ( |x| x. 1 )
306- } else {
307- None
308- } ;
309-
310297 DiagnosticSpan {
311298 file_name : start. file . name . to_string ( ) ,
312299 byte_start : span. lo ( ) . 0 - start. file . start_pos . 0 ,
@@ -318,7 +305,7 @@ impl DiagnosticSpan {
318305 is_primary,
319306 text : DiagnosticSpanLine :: from_span ( span, je) ,
320307 suggested_replacement : suggestion. map ( |x| x. 0 . clone ( ) ) ,
321- suggestion_applicability,
308+ suggestion_applicability : suggestion . map ( |x| x . 1 ) ,
322309 expansion : backtrace_step,
323310 label,
324311 }
0 commit comments