@@ -17,23 +17,23 @@ use syntax::ast;
17
17
use syntax:: ast:: { Ident , NodeId } ;
18
18
19
19
pub struct Module {
20
- name : Option < Ident > ,
21
- attrs : Vec < ast:: Attribute > ,
22
- where : Span ,
23
- structs : Vec < Struct > ,
24
- enums : Vec < Enum > ,
25
- fns : Vec < Function > ,
26
- mods : Vec < Module > ,
27
- id : NodeId ,
28
- typedefs : Vec < Typedef > ,
29
- statics : Vec < Static > ,
30
- traits : Vec < Trait > ,
31
- vis : ast:: Visibility ,
32
- impls : Vec < Impl > ,
33
- foreigns : Vec < ast:: ForeignMod > ,
34
- view_items : Vec < ast:: ViewItem > ,
35
- macros : Vec < Macro > ,
36
- is_crate : bool ,
20
+ pub name : Option < Ident > ,
21
+ pub attrs : Vec < ast:: Attribute > ,
22
+ pub where : Span ,
23
+ pub structs : Vec < Struct > ,
24
+ pub enums : Vec < Enum > ,
25
+ pub fns : Vec < Function > ,
26
+ pub mods : Vec < Module > ,
27
+ pub id : NodeId ,
28
+ pub typedefs : Vec < Typedef > ,
29
+ pub statics : Vec < Static > ,
30
+ pub traits : Vec < Trait > ,
31
+ pub vis : ast:: Visibility ,
32
+ pub impls : Vec < Impl > ,
33
+ pub foreigns : Vec < ast:: ForeignMod > ,
34
+ pub view_items : Vec < ast:: ViewItem > ,
35
+ pub macros : Vec < Macro > ,
36
+ pub is_crate : bool ,
37
37
}
38
38
39
39
impl Module {
@@ -78,94 +78,94 @@ pub enum TypeBound {
78
78
}
79
79
80
80
pub struct Struct {
81
- vis : ast:: Visibility ,
82
- id : NodeId ,
83
- struct_type : StructType ,
84
- name : Ident ,
85
- generics : ast:: Generics ,
86
- attrs : Vec < ast:: Attribute > ,
87
- fields : Vec < ast:: StructField > ,
88
- where : Span ,
81
+ pub vis : ast:: Visibility ,
82
+ pub id : NodeId ,
83
+ pub struct_type : StructType ,
84
+ pub name : Ident ,
85
+ pub generics : ast:: Generics ,
86
+ pub attrs : Vec < ast:: Attribute > ,
87
+ pub fields : Vec < ast:: StructField > ,
88
+ pub where : Span ,
89
89
}
90
90
91
91
pub struct Enum {
92
- vis : ast:: Visibility ,
93
- variants : Vec < Variant > ,
94
- generics : ast:: Generics ,
95
- attrs : Vec < ast:: Attribute > ,
96
- id : NodeId ,
97
- where : Span ,
98
- name : Ident ,
92
+ pub vis : ast:: Visibility ,
93
+ pub variants : Vec < Variant > ,
94
+ pub generics : ast:: Generics ,
95
+ pub attrs : Vec < ast:: Attribute > ,
96
+ pub id : NodeId ,
97
+ pub where : Span ,
98
+ pub name : Ident ,
99
99
}
100
100
101
101
pub struct Variant {
102
- name : Ident ,
103
- attrs : Vec < ast:: Attribute > ,
104
- kind : ast:: VariantKind ,
105
- id : ast:: NodeId ,
106
- vis : ast:: Visibility ,
107
- where : Span ,
102
+ pub name : Ident ,
103
+ pub attrs : Vec < ast:: Attribute > ,
104
+ pub kind : ast:: VariantKind ,
105
+ pub id : ast:: NodeId ,
106
+ pub vis : ast:: Visibility ,
107
+ pub where : Span ,
108
108
}
109
109
110
110
pub struct Function {
111
- decl : ast:: FnDecl ,
112
- attrs : Vec < ast:: Attribute > ,
113
- id : NodeId ,
114
- name : Ident ,
115
- vis : ast:: Visibility ,
116
- purity : ast:: Purity ,
117
- where : Span ,
118
- generics : ast:: Generics ,
111
+ pub decl : ast:: FnDecl ,
112
+ pub attrs : Vec < ast:: Attribute > ,
113
+ pub id : NodeId ,
114
+ pub name : Ident ,
115
+ pub vis : ast:: Visibility ,
116
+ pub purity : ast:: Purity ,
117
+ pub where : Span ,
118
+ pub generics : ast:: Generics ,
119
119
}
120
120
121
121
pub struct Typedef {
122
- ty : ast:: P < ast:: Ty > ,
123
- gen : ast:: Generics ,
124
- name : Ident ,
125
- id : ast:: NodeId ,
126
- attrs : Vec < ast:: Attribute > ,
127
- where : Span ,
128
- vis : ast:: Visibility ,
122
+ pub ty : ast:: P < ast:: Ty > ,
123
+ pub gen : ast:: Generics ,
124
+ pub name : Ident ,
125
+ pub id : ast:: NodeId ,
126
+ pub attrs : Vec < ast:: Attribute > ,
127
+ pub where : Span ,
128
+ pub vis : ast:: Visibility ,
129
129
}
130
130
131
131
pub struct Static {
132
- type_ : ast:: P < ast:: Ty > ,
133
- mutability : ast:: Mutability ,
134
- expr : @ast:: Expr ,
135
- name : Ident ,
136
- attrs : Vec < ast:: Attribute > ,
137
- vis : ast:: Visibility ,
138
- id : ast:: NodeId ,
139
- where : Span ,
132
+ pub type_ : ast:: P < ast:: Ty > ,
133
+ pub mutability : ast:: Mutability ,
134
+ pub expr : @ast:: Expr ,
135
+ pub name : Ident ,
136
+ pub attrs : Vec < ast:: Attribute > ,
137
+ pub vis : ast:: Visibility ,
138
+ pub id : ast:: NodeId ,
139
+ pub where : Span ,
140
140
}
141
141
142
142
pub struct Trait {
143
- name : Ident ,
144
- methods : Vec < ast:: TraitMethod > , //should be TraitMethod
145
- generics : ast:: Generics ,
146
- parents : Vec < ast:: TraitRef > ,
147
- attrs : Vec < ast:: Attribute > ,
148
- id : ast:: NodeId ,
149
- where : Span ,
150
- vis : ast:: Visibility ,
143
+ pub name : Ident ,
144
+ pub methods : Vec < ast:: TraitMethod > , //should be TraitMethod
145
+ pub generics : ast:: Generics ,
146
+ pub parents : Vec < ast:: TraitRef > ,
147
+ pub attrs : Vec < ast:: Attribute > ,
148
+ pub id : ast:: NodeId ,
149
+ pub where : Span ,
150
+ pub vis : ast:: Visibility ,
151
151
}
152
152
153
153
pub struct Impl {
154
- generics : ast:: Generics ,
155
- trait_ : Option < ast:: TraitRef > ,
156
- for_ : ast:: P < ast:: Ty > ,
157
- methods : Vec < @ast:: Method > ,
158
- attrs : Vec < ast:: Attribute > ,
159
- where : Span ,
160
- vis : ast:: Visibility ,
161
- id : ast:: NodeId ,
154
+ pub generics : ast:: Generics ,
155
+ pub trait_ : Option < ast:: TraitRef > ,
156
+ pub for_ : ast:: P < ast:: Ty > ,
157
+ pub methods : Vec < @ast:: Method > ,
158
+ pub attrs : Vec < ast:: Attribute > ,
159
+ pub where : Span ,
160
+ pub vis : ast:: Visibility ,
161
+ pub id : ast:: NodeId ,
162
162
}
163
163
164
164
pub struct Macro {
165
- name : Ident ,
166
- id : ast:: NodeId ,
167
- attrs : Vec < ast:: Attribute > ,
168
- where : Span ,
165
+ pub name : Ident ,
166
+ pub id : ast:: NodeId ,
167
+ pub attrs : Vec < ast:: Attribute > ,
168
+ pub where : Span ,
169
169
}
170
170
171
171
pub fn struct_type_from_def ( sd : & ast:: StructDef ) -> StructType {
0 commit comments