@@ -190,7 +190,7 @@ fn encodable_substructure(cx: &mut ExtCtxt,
190
190
Struct ( _, ref fields) => {
191
191
let emit_struct_field = cx. ident_of ( "emit_struct_field" ) ;
192
192
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 ( ) {
194
194
let name = match name {
195
195
Some ( id) => id. name ,
196
196
None => Symbol :: intern ( & format ! ( "_field{}" , i) ) ,
@@ -213,17 +213,7 @@ fn encodable_substructure(cx: &mut ExtCtxt,
213
213
cx. expr ( span, ExprKind :: Ret ( Some ( call) ) )
214
214
} ;
215
215
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) ;
227
217
stmts. push ( stmt) ;
228
218
}
229
219
0 commit comments