about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2018-05-06 13:30:57 -0700
committerManish Goregaokar <manishsmail@gmail.com>2018-05-21 10:48:12 -0700
commit1d8a4d16a7b1fb1d38302ea38290ace2d6bf2180 (patch)
tree3394ab0dfe78911513cedb9fe2f3bbbfffedeba2 /src/libsyntax_ext
parent30bd586bec5efb8317a6fdf6ce53b64fac567270 (diff)
downloadrust-1d8a4d16a7b1fb1d38302ea38290ace2d6bf2180.tar.gz
rust-1d8a4d16a7b1fb1d38302ea38290ace2d6bf2180.zip
Remove rustc_serialize_exclude_null
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/deriving/encodable.rs14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/libsyntax_ext/deriving/encodable.rs b/src/libsyntax_ext/deriving/encodable.rs
index 2c6c18cc51c..8b409df1f09 100644
--- a/src/libsyntax_ext/deriving/encodable.rs
+++ b/src/libsyntax_ext/deriving/encodable.rs
@@ -190,7 +190,7 @@ fn encodable_substructure(cx: &mut ExtCtxt,
         Struct(_, ref fields) => {
             let emit_struct_field = cx.ident_of("emit_struct_field");
             let mut stmts = Vec::new();
-            for (i, &FieldInfo { name, ref self_, span, attrs, .. }) in fields.iter().enumerate() {
+            for (i, &FieldInfo { name, ref self_, span, .. }) in fields.iter().enumerate() {
                 let name = match name {
                     Some(id) => id.name,
                     None => Symbol::intern(&format!("_field{}", i)),
@@ -213,17 +213,7 @@ fn encodable_substructure(cx: &mut ExtCtxt,
                     cx.expr(span, ExprKind::Ret(Some(call)))
                 };
 
-                // This exists for https://github.com/rust-lang/rust/pull/47540
-                //
-                // If we decide to stabilize that flag this can be removed
-                let expr = if attrs.iter().any(|a| a.check_name("rustc_serialize_exclude_null")) {
-                    let is_some = cx.ident_of("is_some");
-                    let condition = cx.expr_method_call(span, self_.clone(), is_some, vec![]);
-                    cx.expr_if(span, condition, call, None)
-                } else {
-                    call
-                };
-                let stmt = cx.stmt_expr(expr);
+                let stmt = cx.stmt_expr(call);
                 stmts.push(stmt);
             }