about summary refs log tree commit diff
path: root/src/libsyntax/json.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2018-01-24 11:50:30 +0530
committerManish Goregaokar <manishsmail@gmail.com>2018-01-29 11:41:03 +0530
commit540f95d9fad41a605e4c8b898d77f47374a76cbd (patch)
treef8b26690a103e16aec8df59b458e702700899fc7 /src/libsyntax/json.rs
parenta53bdc6212b9abf8538a877ebfde214120bf061f (diff)
downloadrust-540f95d9fad41a605e4c8b898d77f47374a76cbd.tar.gz
rust-540f95d9fad41a605e4c8b898d77f47374a76cbd.zip
Add internal-only rustc_serialize_exclude_null attribute for making the field only exist in the json if the flag is passed
Diffstat (limited to 'src/libsyntax/json.rs')
-rw-r--r--src/libsyntax/json.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libsyntax/json.rs b/src/libsyntax/json.rs
index 7a8717ada4c..681e14a6137 100644
--- a/src/libsyntax/json.rs
+++ b/src/libsyntax/json.rs
@@ -108,6 +108,7 @@ struct Diagnostic {
 }
 
 #[derive(RustcEncodable)]
+#[allow(unused_attributes)]
 struct DiagnosticSpan {
     file_name: String,
     byte_start: u32,
@@ -129,6 +130,7 @@ struct DiagnosticSpan {
     /// that should be sliced in atop this span.
     suggested_replacement: Option<String>,
     /// If the suggestion is approximate
+    #[rustc_serialize_exclude_null]
     suggestion_approximate: Option<bool>,
     /// Macro invocations that created the code at this span, if any.
     expansion: Option<Box<DiagnosticSpanMacroExpansion>>,