1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
b0VIM 7.4 �
EU��6, erickt Erick-Tryzelaar-MBP.local ~erickt/projects/rust/rust-serde/serde_macros/src/de.rs utf-8
3210 #"! U tp
@ L C � � k y �
� � W v . � ad � � @ � � � � � � � � � u U 1 � � � � � q m 6 5 �
�
U
N
M
� � � � � a � � � � � � � � O N * �
Z
$
� � � � � � � � � � � b Q . � � � � n X 9 % � � � � � u Y : & � � � � � � ~ l K : � � � � � ^ > � � � � � p V 1 � � � � � z ` D % � � � � � � p T item.ident, &builder, cx, deserialize_struct( (false, true) => { } ) unnamed_fields, ty, impl_generics, item.ident, &builder, cx, deserialize_tuple_struct( (true, false) => { } ) item.ident, &builder, cx, deserialize_unit_struct( (true, true) => { match (named_fields.is_empty(), unnamed_fields == 0) { } } ast::UnnamedField(_) => { unnamed_fields += 1; } ast::NamedField(name, _) => { named_fields.push(name); } match field.node.kind { for field in struct_def.fields.iter() { let mut unnamed_fields = 0; let mut named_fields = vec![]; ) -> P<ast::Expr> { struct_def: &ast::StructDef, ty: P<ast::Ty>, impl_generics: &ast::Generics, item: &Item, builder: &aster::AstBuilder, cx: &ExtCtxt, fn deserialize_item_struct( } } _ => cx.bug("expected ItemStruct or ItemEnum in #[derive(Deserialize)]") } ) enum_def, ty, impl_generics, item.ident, builder, cx, deserialize_item_enum( ast::ItemEnum(ref enum_def, _) => { } ) struct_def, ty, impl_generics, item, builder, cx, deserialize_item_struct( ast::ItemStruct(ref struct_def, _) => { match item.node { ) -> P<ast::Expr> { ty: P<ast::Ty>, impl_generics: &ast::Generics, item: &Item, builder: &aster::AstBuilder, cx: &ExtCtxt, fn deserialize_body( } println!("done!" println!("done!"); ).unwrap(); } } $body { where __D: ::serde::de::Deserializer, fn deserialize<__D>(deserializer: &mut __D) -> ::std::result::Result<$ty, __D::Error>