@@ -23,7 +23,7 @@ use codemap::{CodeMap, FilePathMapping};
2323use  syntax_pos:: { self ,  MacroBacktrace ,  Span ,  SpanLabel ,  MultiSpan } ; 
2424use  errors:: registry:: Registry ; 
2525use  errors:: { DiagnosticBuilder ,  SubDiagnostic ,  CodeSuggestion ,  CodeMapper } ; 
26- use  errors:: DiagnosticId ; 
26+ use  errors:: { DiagnosticId ,   Applicability } ; 
2727use  errors:: emitter:: { Emitter ,  EmitterWriter } ; 
2828
2929use  rustc_data_structures:: sync:: { self ,  Lrc } ; 
@@ -39,21 +39,21 @@ pub struct JsonEmitter {
3939 cm :  Lrc < CodeMapper  + sync:: Send  + sync:: Sync > , 
4040 pretty :  bool , 
4141 /// Whether "approximate suggestions" are enabled in the config 
42- approximate_suggestions :  bool , 
42+ suggestion_applicability :  bool , 
4343 ui_testing :  bool , 
4444} 
4545
4646impl  JsonEmitter  { 
4747 pub  fn  stderr ( registry :  Option < Registry > , 
4848 code_map :  Lrc < CodeMap > , 
4949 pretty :  bool , 
50-  approximate_suggestions :  bool )  -> JsonEmitter  { 
50+  suggestion_applicability :  bool )  -> JsonEmitter  { 
5151 JsonEmitter  { 
5252 dst :  Box :: new ( io:: stderr ( ) ) , 
5353 registry, 
5454 cm :  code_map, 
5555 pretty, 
56-  approximate_suggestions , 
56+  suggestion_applicability , 
5757 ui_testing :  false , 
5858 } 
5959 } 
@@ -68,13 +68,13 @@ impl JsonEmitter {
6868 registry :  Option < Registry > , 
6969 code_map :  Lrc < CodeMap > , 
7070 pretty :  bool , 
71-  approximate_suggestions :  bool )  -> JsonEmitter  { 
71+  suggestion_applicability :  bool )  -> JsonEmitter  { 
7272 JsonEmitter  { 
7373 dst, 
7474 registry, 
7575 cm :  code_map, 
7676 pretty, 
77-  approximate_suggestions , 
77+  suggestion_applicability , 
7878 ui_testing :  false , 
7979 } 
8080 } 
@@ -138,7 +138,7 @@ struct DiagnosticSpan {
138138suggested_replacement :  Option < String > , 
139139 /// If the suggestion is approximate 
140140#[ rustc_serialize_exclude_null]  
141-  suggestion_approximate :  Option < bool > , 
141+  suggestion_applicability :  Option < Applicability > , 
142142 /// Macro invocations that created the code at this span, if any. 
143143expansion :  Option < Box < DiagnosticSpanMacroExpansion > > , 
144144} 
@@ -239,7 +239,7 @@ impl Diagnostic {
239239
240240impl  DiagnosticSpan  { 
241241 fn  from_span_label ( span :  SpanLabel , 
242-  suggestion :  Option < ( & String ,  bool ) > , 
242+  suggestion :  Option < ( & String ,  Applicability ) > , 
243243 je :  & JsonEmitter ) 
244244 -> DiagnosticSpan  { 
245245 Self :: from_span_etc ( span. span , 
@@ -252,7 +252,7 @@ impl DiagnosticSpan {
252252 fn  from_span_etc ( span :  Span , 
253253 is_primary :  bool , 
254254 label :  Option < String > , 
255-  suggestion :  Option < ( & String ,  bool ) > , 
255+  suggestion :  Option < ( & String ,  Applicability ) > , 
256256 je :  & JsonEmitter ) 
257257 -> DiagnosticSpan  { 
258258 // obtain the full backtrace from the `macro_backtrace` 
@@ -272,7 +272,7 @@ impl DiagnosticSpan {
272272 fn  from_span_full ( span :  Span , 
273273 is_primary :  bool , 
274274 label :  Option < String > , 
275-  suggestion :  Option < ( & String ,  bool ) > , 
275+  suggestion :  Option < ( & String ,  Applicability ) > , 
276276 mut  backtrace :  vec:: IntoIter < MacroBacktrace > , 
277277 je :  & JsonEmitter ) 
278278 -> DiagnosticSpan  { 
@@ -301,7 +301,7 @@ impl DiagnosticSpan {
301301 } ) 
302302 } ) ; 
303303
304-  let  suggestion_approximate  = if  je. approximate_suggestions  { 
304+  let  suggestion_applicability  = if  je. suggestion_applicability  { 
305305 suggestion. map ( |x| x. 1 ) 
306306 }  else  { 
307307 None 
@@ -318,7 +318,7 @@ impl DiagnosticSpan {
318318 is_primary, 
319319 text :  DiagnosticSpanLine :: from_span ( span,  je) , 
320320 suggested_replacement :  suggestion. map ( |x| x. 0 . clone ( ) ) , 
321-  suggestion_approximate , 
321+  suggestion_applicability , 
322322 expansion :  backtrace_step, 
323323 label, 
324324 } 
@@ -344,7 +344,7 @@ impl DiagnosticSpan {
344344 } ; 
345345 DiagnosticSpan :: from_span_label ( span_label, 
346346 Some ( ( & suggestion_inner. snippet , 
347-  suggestion. approximate ) ) , 
347+  suggestion. applicability ) ) , 
348348 je) 
349349 } ) 
350350 } ) 
0 commit comments