@@ -26,16 +26,16 @@ use syntax::diagnostic::expect;
2626
2727pub struct StaticMethodInfo {
2828 ident : ast:: Ident ,
29- def_id : ast:: def_id ,
29+ def_id : ast:: DefId ,
3030 purity : ast:: purity
3131}
3232
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 {
3434 let cdata = cstore:: get_crate_data ( cstore, def. crate ) . data ;
3535 return decoder:: get_symbol ( cdata, def. node ) ;
3636}
3737
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 )
3939 -> uint {
4040 let cdata = cstore:: get_crate_data ( cstore, def. crate ) . data ;
4141 return decoder:: get_type_param_count ( cdata, def. node ) ;
@@ -51,7 +51,7 @@ pub fn each_lang_item(cstore: @mut cstore::CStore,
5151
5252/// Iterates over each child of the given item.
5353pub fn each_child_of_item ( cstore : @mut cstore:: CStore ,
54- def_id : ast:: def_id ,
54+ def_id : ast:: DefId ,
5555 callback : & fn ( decoder:: DefLike , ast:: Ident ) ) {
5656 let crate_data = cstore:: get_crate_data ( cstore, def_id. crate ) ;
5757 let get_crate_data: decoder:: GetCrateDataCb = |cnum| {
@@ -79,7 +79,7 @@ pub fn each_top_level_item_of_crate(cstore: @mut cstore::CStore,
7979 callback)
8080}
8181
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 {
8383 let cstore = tcx. cstore ;
8484 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
8585 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 {
9292
9393pub enum found_ast {
9494 found( ast:: inlined_item ) ,
95- found_parent( ast:: def_id , ast:: inlined_item ) ,
95+ found_parent( ast:: DefId , ast:: inlined_item ) ,
9696 not_found,
9797}
9898
9999// Finds the AST for this item in the crate metadata, if any. If the item was
100100// not marked for inlining, then the AST will not be present and hence none
101101// 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 ,
103103 decode_inlined_item : decoder:: decode_inlined_item )
104104 -> found_ast {
105105 let cstore = tcx. cstore ;
@@ -108,102 +108,102 @@ pub fn maybe_get_item_ast(tcx: ty::ctxt, def: ast::def_id,
108108 decode_inlined_item)
109109}
110110
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 )
112112 -> ~[ @ty:: VariantInfo ] {
113113 let cstore = tcx. cstore ;
114114 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
115115 return decoder:: get_enum_variants ( cstore. intr , cdata, def. node , tcx)
116116}
117117
118118/// 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 )
120120 -> ty:: Impl {
121121 let cdata = cstore:: get_crate_data ( tcx. cstore , impl_def_id. crate ) ;
122122 decoder:: get_impl ( tcx. cstore . intr , cdata, impl_def_id. node , tcx)
123123}
124124
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 {
126126 let cdata = cstore:: get_crate_data ( tcx. cstore , def. crate ) ;
127127 decoder:: get_method ( tcx. cstore . intr , cdata, def. node , tcx)
128128}
129129
130130pub fn get_method_name_and_explicit_self ( cstore : @mut cstore:: CStore ,
131- def : ast:: def_id )
131+ def : ast:: DefId )
132132 -> ( ast:: Ident , ast:: explicit_self_ )
133133{
134134 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
135135 decoder:: get_method_name_and_explicit_self ( cstore. intr , cdata, def. node )
136136}
137137
138138pub fn get_trait_method_def_ids ( cstore : @mut cstore:: CStore ,
139- def : ast:: def_id ) -> ~[ ast:: def_id ] {
139+ def : ast:: DefId ) -> ~[ ast:: DefId ] {
140140 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
141141 decoder:: get_trait_method_def_ids ( cdata, def. node )
142142}
143143
144144pub fn get_provided_trait_methods ( tcx : ty:: ctxt ,
145- def : ast:: def_id )
145+ def : ast:: DefId )
146146 -> ~[ @ty:: Method ] {
147147 let cstore = tcx. cstore ;
148148 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
149149 decoder:: get_provided_trait_methods ( cstore. intr , cdata, def. node , tcx)
150150}
151151
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 ] {
153153 let cstore = tcx. cstore ;
154154 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
155155 decoder:: get_supertraits ( cdata, def. node , tcx)
156156}
157157
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 )
159159 -> Option < ast:: Ident > {
160160 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
161161 decoder:: get_type_name_if_impl ( cdata, def. node )
162162}
163163
164164pub fn get_static_methods_if_impl ( cstore : @mut cstore:: CStore ,
165- def : ast:: def_id )
165+ def : ast:: DefId )
166166 -> Option < ~[ StaticMethodInfo ] > {
167167 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
168168 decoder:: get_static_methods_if_impl ( cstore. intr , cdata, def. node )
169169}
170170
171171pub fn get_item_attrs ( cstore : @mut cstore:: CStore ,
172- def_id : ast:: def_id ,
172+ def_id : ast:: DefId ,
173173 f : & fn ( ~[ @ast:: MetaItem ] ) ) {
174174 let cdata = cstore:: get_crate_data ( cstore, def_id. crate ) ;
175175 decoder:: get_item_attrs ( cdata, def_id. node , f)
176176}
177177
178178pub fn get_struct_fields ( cstore : @mut cstore:: CStore ,
179- def : ast:: def_id )
179+ def : ast:: DefId )
180180 -> ~[ ty:: field_ty ] {
181181 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
182182 decoder:: get_struct_fields ( cstore. intr , cdata, def. node )
183183}
184184
185185pub fn get_type ( tcx : ty:: ctxt ,
186- def : ast:: def_id )
186+ def : ast:: DefId )
187187 -> ty:: ty_param_bounds_and_ty {
188188 let cstore = tcx. cstore ;
189189 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
190190 decoder:: get_type ( cdata, def. node , tcx)
191191}
192192
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 {
194194 let cstore = tcx. cstore ;
195195 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
196196 decoder:: get_trait_def ( cdata, def. node , tcx)
197197}
198198
199199pub 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 > {
201201 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
202202 return decoder:: get_region_param ( cdata, def. node ) ;
203203}
204204
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 {
207207 let cstore = tcx. cstore ;
208208 let cdata = cstore:: get_crate_data ( cstore, class_id. crate ) ;
209209 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,
229229// Given a def_id for an impl, return the trait it implements,
230230// if there is one.
231231pub fn get_impl_trait ( tcx : ty:: ctxt ,
232- def : ast:: def_id ) -> Option < @ty:: TraitRef > {
232+ def : ast:: DefId ) -> Option < @ty:: TraitRef > {
233233 let cstore = tcx. cstore ;
234234 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
235235 decoder:: get_impl_trait ( cdata, def. node , tcx)
236236}
237237
238238// Given a def_id for an impl, return information about its vtables
239239pub fn get_impl_vtables ( tcx : ty:: ctxt ,
240- def : ast:: def_id ) -> typeck:: impl_res {
240+ def : ast:: DefId ) -> typeck:: impl_res {
241241 let cstore = tcx. cstore ;
242242 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
243243 decoder:: get_impl_vtables ( cdata, def. node , tcx)
244244}
245245
246246pub fn get_impl_method ( cstore : @mut cstore:: CStore ,
247- def : ast:: def_id ,
247+ def : ast:: DefId ,
248248 mname : ast:: Ident )
249- -> Option < ast:: def_id > {
249+ -> Option < ast:: DefId > {
250250 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
251251 decoder:: get_impl_method ( cstore. intr , cdata, def. node , mname)
252252}
253253
254254pub fn get_item_visibility ( cstore : @mut cstore:: CStore ,
255- def_id : ast:: def_id )
255+ def_id : ast:: DefId )
256256 -> ast:: visibility {
257257 let cdata = cstore:: get_crate_data ( cstore, def_id. crate ) ;
258258 decoder:: get_item_visibility ( cdata, def_id. node )
@@ -267,21 +267,21 @@ pub fn get_link_args_for_crate(cstore: @mut cstore::CStore,
267267
268268pub fn each_impl ( cstore : @mut cstore:: CStore ,
269269 crate_num : ast:: CrateNum ,
270- callback : & fn ( ast:: def_id ) ) {
270+ callback : & fn ( ast:: DefId ) ) {
271271 let cdata = cstore:: get_crate_data ( cstore, crate_num) ;
272272 decoder:: each_impl ( cdata, callback)
273273}
274274
275275pub 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 ) ) {
278278 let cdata = cstore:: get_crate_data ( cstore, def_id. crate ) ;
279279 decoder:: each_implementation_for_type ( cdata, def_id. node , callback)
280280}
281281
282282pub 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 ) ) {
285285 let cdata = cstore:: get_crate_data ( cstore, def_id. crate ) ;
286286 decoder:: each_implementation_for_trait ( cdata, def_id. node , callback)
287287}
@@ -290,9 +290,9 @@ pub fn each_implementation_for_trait(cstore: @mut cstore::CStore,
290290/// default method or an implementation of a trait method), returns the ID of
291291/// the trait that the method belongs to. Otherwise, returns `None`.
292292pub fn get_trait_of_method ( cstore : @mut cstore:: CStore ,
293- def_id : ast:: def_id ,
293+ def_id : ast:: DefId ,
294294 tcx : ty:: ctxt )
295- -> Option < ast:: def_id > {
295+ -> Option < ast:: DefId > {
296296 let cdata = cstore:: get_crate_data ( cstore, def_id. crate ) ;
297297 decoder:: get_trait_of_method ( cdata, def_id. node , tcx)
298298}
0 commit comments