Skip to content

Commit 1d8a4d1

Browse files
committed
Remove rustc_serialize_exclude_null
1 parent 30bd586 commit 1d8a4d1

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

src/libsyntax/feature_gate.rs

-5
Original file line numberDiff line numberDiff line change
@@ -846,11 +846,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
846846
is just used for rustc unit tests \
847847
and will never be stable",
848848
cfg_fn!(rustc_attrs))),
849-
("rustc_serialize_exclude_null", Normal, Gated(Stability::Unstable,
850-
"rustc_attrs",
851-
"the `#[rustc_serialize_exclude_null]` attribute \
852-
is an internal-only feature",
853-
cfg_fn!(rustc_attrs))),
854849
("rustc_synthetic", Whitelisted, Gated(Stability::Unstable,
855850
"rustc_attrs",
856851
"this attribute \

src/libsyntax_ext/deriving/encodable.rs

+2-12
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ fn encodable_substructure(cx: &mut ExtCtxt,
190190
Struct(_, ref fields) => {
191191
let emit_struct_field = cx.ident_of("emit_struct_field");
192192
let mut stmts = Vec::new();
193-
for (i, &FieldInfo { name, ref self_, span, attrs, .. }) in fields.iter().enumerate() {
193+
for (i, &FieldInfo { name, ref self_, span, .. }) in fields.iter().enumerate() {
194194
let name = match name {
195195
Some(id) => id.name,
196196
None => Symbol::intern(&format!("_field{}", i)),
@@ -213,17 +213,7 @@ fn encodable_substructure(cx: &mut ExtCtxt,
213213
cx.expr(span, ExprKind::Ret(Some(call)))
214214
};
215215

216-
// This exists for https://github.com/rust-lang/rust/pull/47540
217-
//
218-
// If we decide to stabilize that flag this can be removed
219-
let expr = if attrs.iter().any(|a| a.check_name("rustc_serialize_exclude_null")) {
220-
let is_some = cx.ident_of("is_some");
221-
let condition = cx.expr_method_call(span, self_.clone(), is_some, vec![]);
222-
cx.expr_if(span, condition, call, None)
223-
} else {
224-
call
225-
};
226-
let stmt = cx.stmt_expr(expr);
216+
let stmt = cx.stmt_expr(call);
227217
stmts.push(stmt);
228218
}
229219

0 commit comments

Comments
 (0)