diff options
| author | bors <bors@rust-lang.org> | 2018-05-22 01:53:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-05-22 01:53:55 +0000 |
| commit | 38fd7ea50adf894ae6235abba883ea9981996af9 (patch) | |
| tree | 0289ad820cc693331f3f6dd4904b94928a97f3b5 /src/libsyntax | |
| parent | 65a16c000720f286c91747b91e6d9caa7b1bb63c (diff) | |
| parent | b0e66386f761ef7dff9edba1f81a693c94e1adfa (diff) | |
| download | rust-38fd7ea50adf894ae6235abba883ea9981996af9.tar.gz rust-38fd7ea50adf894ae6235abba883ea9981996af9.zip | |
Auto merge of #50486 - Manishearth:approx-stab, r=nrc
Stabilize suggestion applicability field in json output cc @killercup r? @nrc
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 5 | ||||
| -rw-r--r-- | src/libsyntax/json.rs | 21 |
2 files changed, 4 insertions, 22 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 604df862dc2..709c3653b02 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -846,11 +846,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_serialize_exclude_null", Normal, Gated(Stability::Unstable, - "rustc_attrs", - "the `#[rustc_serialize_exclude_null]` attribute \ - is an internal-only feature", - cfg_fn!(rustc_attrs))), ("rustc_synthetic", Whitelisted, Gated(Stability::Unstable, "rustc_attrs", "this attribute \ 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, } |
