@@ -26,16 +26,16 @@ use syntax::diagnostic::expect;
26
26
27
27
pub struct StaticMethodInfo {
28
28
ident : ast:: Ident ,
29
- def_id : ast:: def_id ,
29
+ def_id : ast:: DefId ,
30
30
purity : ast:: purity
31
31
}
32
32
33
- pub fn get_symbol ( cstore : @mut cstore:: CStore , def : ast:: def_id ) -> ~str {
33
+ pub fn get_symbol ( cstore : @mut cstore:: CStore , def : ast:: DefId ) -> ~str {
34
34
let cdata = cstore:: get_crate_data ( cstore, def. crate ) . data ;
35
35
return decoder:: get_symbol ( cdata, def. node ) ;
36
36
}
37
37
38
- pub fn get_type_param_count ( cstore : @mut cstore:: CStore , def : ast:: def_id )
38
+ pub fn get_type_param_count ( cstore : @mut cstore:: CStore , def : ast:: DefId )
39
39
-> uint {
40
40
let cdata = cstore:: get_crate_data ( cstore, def. crate ) . data ;
41
41
return decoder:: get_type_param_count ( cdata, def. node ) ;
@@ -51,7 +51,7 @@ pub fn each_lang_item(cstore: @mut cstore::CStore,
51
51
52
52
/// Iterates over each child of the given item.
53
53
pub fn each_child_of_item ( cstore : @mut cstore:: CStore ,
54
- def_id : ast:: def_id ,
54
+ def_id : ast:: DefId ,
55
55
callback : & fn ( decoder:: DefLike , ast:: Ident ) ) {
56
56
let crate_data = cstore:: get_crate_data ( cstore, def_id. crate ) ;
57
57
let get_crate_data: decoder:: GetCrateDataCb = |cnum| {
@@ -79,7 +79,7 @@ pub fn each_top_level_item_of_crate(cstore: @mut cstore::CStore,
79
79
callback)
80
80
}
81
81
82
- pub fn get_item_path ( tcx : ty:: ctxt , def : ast:: def_id ) -> ast_map:: path {
82
+ pub fn get_item_path ( tcx : ty:: ctxt , def : ast:: DefId ) -> ast_map:: path {
83
83
let cstore = tcx. cstore ;
84
84
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
85
85
let path = decoder:: get_item_path ( cdata, def. node ) ;
@@ -92,14 +92,14 @@ pub fn get_item_path(tcx: ty::ctxt, def: ast::def_id) -> ast_map::path {
92
92
93
93
pub enum found_ast {
94
94
found( ast:: inlined_item ) ,
95
- found_parent( ast:: def_id , ast:: inlined_item ) ,
95
+ found_parent( ast:: DefId , ast:: inlined_item ) ,
96
96
not_found,
97
97
}
98
98
99
99
// Finds the AST for this item in the crate metadata, if any. If the item was
100
100
// not marked for inlining, then the AST will not be present and hence none
101
101
// will be returned.
102
- pub fn maybe_get_item_ast ( tcx : ty:: ctxt , def : ast:: def_id ,
102
+ pub fn maybe_get_item_ast ( tcx : ty:: ctxt , def : ast:: DefId ,
103
103
decode_inlined_item : decoder:: decode_inlined_item )
104
104
-> found_ast {
105
105
let cstore = tcx. cstore ;
@@ -108,102 +108,102 @@ pub fn maybe_get_item_ast(tcx: ty::ctxt, def: ast::def_id,
108
108
decode_inlined_item)
109
109
}
110
110
111
- pub fn get_enum_variants ( tcx : ty:: ctxt , def : ast:: def_id )
111
+ pub fn get_enum_variants ( tcx : ty:: ctxt , def : ast:: DefId )
112
112
-> ~[ @ty:: VariantInfo ] {
113
113
let cstore = tcx. cstore ;
114
114
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
115
115
return decoder:: get_enum_variants ( cstore. intr , cdata, def. node , tcx)
116
116
}
117
117
118
118
/// Returns information about the given implementation.
119
- pub fn get_impl ( tcx : ty:: ctxt , impl_def_id : ast:: def_id )
119
+ pub fn get_impl ( tcx : ty:: ctxt , impl_def_id : ast:: DefId )
120
120
-> ty:: Impl {
121
121
let cdata = cstore:: get_crate_data ( tcx. cstore , impl_def_id. crate ) ;
122
122
decoder:: get_impl ( tcx. cstore . intr , cdata, impl_def_id. node , tcx)
123
123
}
124
124
125
- pub fn get_method ( tcx : ty:: ctxt , def : ast:: def_id ) -> ty:: Method {
125
+ pub fn get_method ( tcx : ty:: ctxt , def : ast:: DefId ) -> ty:: Method {
126
126
let cdata = cstore:: get_crate_data ( tcx. cstore , def. crate ) ;
127
127
decoder:: get_method ( tcx. cstore . intr , cdata, def. node , tcx)
128
128
}
129
129
130
130
pub fn get_method_name_and_explicit_self ( cstore : @mut cstore:: CStore ,
131
- def : ast:: def_id )
131
+ def : ast:: DefId )
132
132
-> ( ast:: Ident , ast:: explicit_self_ )
133
133
{
134
134
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
135
135
decoder:: get_method_name_and_explicit_self ( cstore. intr , cdata, def. node )
136
136
}
137
137
138
138
pub fn get_trait_method_def_ids ( cstore : @mut cstore:: CStore ,
139
- def : ast:: def_id ) -> ~[ ast:: def_id ] {
139
+ def : ast:: DefId ) -> ~[ ast:: DefId ] {
140
140
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
141
141
decoder:: get_trait_method_def_ids ( cdata, def. node )
142
142
}
143
143
144
144
pub fn get_provided_trait_methods ( tcx : ty:: ctxt ,
145
- def : ast:: def_id )
145
+ def : ast:: DefId )
146
146
-> ~[ @ty:: Method ] {
147
147
let cstore = tcx. cstore ;
148
148
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
149
149
decoder:: get_provided_trait_methods ( cstore. intr , cdata, def. node , tcx)
150
150
}
151
151
152
- pub fn get_supertraits ( tcx : ty:: ctxt , def : ast:: def_id ) -> ~[ @ty:: TraitRef ] {
152
+ pub fn get_supertraits ( tcx : ty:: ctxt , def : ast:: DefId ) -> ~[ @ty:: TraitRef ] {
153
153
let cstore = tcx. cstore ;
154
154
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
155
155
decoder:: get_supertraits ( cdata, def. node , tcx)
156
156
}
157
157
158
- pub fn get_type_name_if_impl ( cstore : @mut cstore:: CStore , def : ast:: def_id )
158
+ pub fn get_type_name_if_impl ( cstore : @mut cstore:: CStore , def : ast:: DefId )
159
159
-> Option < ast:: Ident > {
160
160
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
161
161
decoder:: get_type_name_if_impl ( cdata, def. node )
162
162
}
163
163
164
164
pub fn get_static_methods_if_impl ( cstore : @mut cstore:: CStore ,
165
- def : ast:: def_id )
165
+ def : ast:: DefId )
166
166
-> Option < ~[ StaticMethodInfo ] > {
167
167
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
168
168
decoder:: get_static_methods_if_impl ( cstore. intr , cdata, def. node )
169
169
}
170
170
171
171
pub fn get_item_attrs ( cstore : @mut cstore:: CStore ,
172
- def_id : ast:: def_id ,
172
+ def_id : ast:: DefId ,
173
173
f : & fn ( ~[ @ast:: MetaItem ] ) ) {
174
174
let cdata = cstore:: get_crate_data ( cstore, def_id. crate ) ;
175
175
decoder:: get_item_attrs ( cdata, def_id. node , f)
176
176
}
177
177
178
178
pub fn get_struct_fields ( cstore : @mut cstore:: CStore ,
179
- def : ast:: def_id )
179
+ def : ast:: DefId )
180
180
-> ~[ ty:: field_ty ] {
181
181
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
182
182
decoder:: get_struct_fields ( cstore. intr , cdata, def. node )
183
183
}
184
184
185
185
pub fn get_type ( tcx : ty:: ctxt ,
186
- def : ast:: def_id )
186
+ def : ast:: DefId )
187
187
-> ty:: ty_param_bounds_and_ty {
188
188
let cstore = tcx. cstore ;
189
189
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
190
190
decoder:: get_type ( cdata, def. node , tcx)
191
191
}
192
192
193
- pub fn get_trait_def ( tcx : ty:: ctxt , def : ast:: def_id ) -> ty:: TraitDef {
193
+ pub fn get_trait_def ( tcx : ty:: ctxt , def : ast:: DefId ) -> ty:: TraitDef {
194
194
let cstore = tcx. cstore ;
195
195
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
196
196
decoder:: get_trait_def ( cdata, def. node , tcx)
197
197
}
198
198
199
199
pub fn get_region_param ( cstore : @mut metadata:: cstore:: CStore ,
200
- def : ast:: def_id ) -> Option < ty:: region_variance > {
200
+ def : ast:: DefId ) -> Option < ty:: region_variance > {
201
201
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
202
202
return decoder:: get_region_param ( cdata, def. node ) ;
203
203
}
204
204
205
- pub fn get_field_type ( tcx : ty:: ctxt , class_id : ast:: def_id ,
206
- def : ast:: def_id ) -> ty:: ty_param_bounds_and_ty {
205
+ pub fn get_field_type ( tcx : ty:: ctxt , class_id : ast:: DefId ,
206
+ def : ast:: DefId ) -> ty:: ty_param_bounds_and_ty {
207
207
let cstore = tcx. cstore ;
208
208
let cdata = cstore:: get_crate_data ( cstore, class_id. crate ) ;
209
209
let all_items = reader:: get_doc ( reader:: Doc ( cdata. data ) , tag_items) ;
@@ -229,30 +229,30 @@ pub fn get_field_type(tcx: ty::ctxt, class_id: ast::def_id,
229
229
// Given a def_id for an impl, return the trait it implements,
230
230
// if there is one.
231
231
pub fn get_impl_trait ( tcx : ty:: ctxt ,
232
- def : ast:: def_id ) -> Option < @ty:: TraitRef > {
232
+ def : ast:: DefId ) -> Option < @ty:: TraitRef > {
233
233
let cstore = tcx. cstore ;
234
234
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
235
235
decoder:: get_impl_trait ( cdata, def. node , tcx)
236
236
}
237
237
238
238
// Given a def_id for an impl, return information about its vtables
239
239
pub fn get_impl_vtables ( tcx : ty:: ctxt ,
240
- def : ast:: def_id ) -> typeck:: impl_res {
240
+ def : ast:: DefId ) -> typeck:: impl_res {
241
241
let cstore = tcx. cstore ;
242
242
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
243
243
decoder:: get_impl_vtables ( cdata, def. node , tcx)
244
244
}
245
245
246
246
pub fn get_impl_method ( cstore : @mut cstore:: CStore ,
247
- def : ast:: def_id ,
247
+ def : ast:: DefId ,
248
248
mname : ast:: Ident )
249
- -> Option < ast:: def_id > {
249
+ -> Option < ast:: DefId > {
250
250
let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
251
251
decoder:: get_impl_method ( cstore. intr , cdata, def. node , mname)
252
252
}
253
253
254
254
pub fn get_item_visibility ( cstore : @mut cstore:: CStore ,
255
- def_id : ast:: def_id )
255
+ def_id : ast:: DefId )
256
256
-> ast:: visibility {
257
257
let cdata = cstore:: get_crate_data ( cstore, def_id. crate ) ;
258
258
decoder:: get_item_visibility ( cdata, def_id. node )
@@ -267,21 +267,21 @@ pub fn get_link_args_for_crate(cstore: @mut cstore::CStore,
267
267
268
268
pub fn each_impl ( cstore : @mut cstore:: CStore ,
269
269
crate_num : ast:: CrateNum ,
270
- callback : & fn ( ast:: def_id ) ) {
270
+ callback : & fn ( ast:: DefId ) ) {
271
271
let cdata = cstore:: get_crate_data ( cstore, crate_num) ;
272
272
decoder:: each_impl ( cdata, callback)
273
273
}
274
274
275
275
pub fn each_implementation_for_type ( cstore : @mut cstore:: CStore ,
276
- def_id : ast:: def_id ,
277
- callback : & fn ( ast:: def_id ) ) {
276
+ def_id : ast:: DefId ,
277
+ callback : & fn ( ast:: DefId ) ) {
278
278
let cdata = cstore:: get_crate_data ( cstore, def_id. crate ) ;
279
279
decoder:: each_implementation_for_type ( cdata, def_id. node , callback)
280
280
}
281
281
282
282
pub fn each_implementation_for_trait ( cstore : @mut cstore:: CStore ,
283
- def_id : ast:: def_id ,
284
- callback : & fn ( ast:: def_id ) ) {
283
+ def_id : ast:: DefId ,
284
+ callback : & fn ( ast:: DefId ) ) {
285
285
let cdata = cstore:: get_crate_data ( cstore, def_id. crate ) ;
286
286
decoder:: each_implementation_for_trait ( cdata, def_id. node , callback)
287
287
}
@@ -290,9 +290,9 @@ pub fn each_implementation_for_trait(cstore: @mut cstore::CStore,
290
290
/// default method or an implementation of a trait method), returns the ID of
291
291
/// the trait that the method belongs to. Otherwise, returns `None`.
292
292
pub fn get_trait_of_method ( cstore : @mut cstore:: CStore ,
293
- def_id : ast:: def_id ,
293
+ def_id : ast:: DefId ,
294
294
tcx : ty:: ctxt )
295
- -> Option < ast:: def_id > {
295
+ -> Option < ast:: DefId > {
296
296
let cdata = cstore:: get_crate_data ( cstore, def_id. crate ) ;
297
297
decoder:: get_trait_of_method ( cdata, def_id. node , tcx)
298
298
}
0 commit comments