@@ -16,6 +16,7 @@ use metadata::common::*;
16
16
use metadata:: cstore;
17
17
use metadata:: decoder;
18
18
use middle:: lang_items;
19
+ use middle:: resolve;
19
20
use middle:: ty;
20
21
use middle:: typeck;
21
22
use middle:: subst:: VecPerParamSpace ;
@@ -121,30 +122,33 @@ pub fn get_enum_variants(tcx: &ty::ctxt, def: ast::DefId)
121
122
}
122
123
123
124
/// Returns information about the given implementation.
124
- pub fn get_impl_methods ( cstore : & cstore:: CStore , impl_def_id : ast:: DefId )
125
- -> Vec < ast :: DefId > {
125
+ pub fn get_impl_items ( cstore : & cstore:: CStore , impl_def_id : ast:: DefId )
126
+ -> Vec < ty :: ImplOrTraitItemId > {
126
127
let cdata = cstore. get_crate_data ( impl_def_id. krate ) ;
127
- decoder:: get_impl_methods ( & * cdata, impl_def_id. node )
128
+ decoder:: get_impl_items ( & * cdata, impl_def_id. node )
128
129
}
129
130
130
- pub fn get_method ( tcx : & ty:: ctxt , def : ast:: DefId ) -> ty:: Method {
131
+ pub fn get_impl_or_trait_item ( tcx : & ty:: ctxt , def : ast:: DefId )
132
+ -> ty:: ImplOrTraitItem {
131
133
let cdata = tcx. sess . cstore . get_crate_data ( def. krate ) ;
132
- decoder:: get_method ( tcx. sess . cstore . intr . clone ( ) , & * cdata, def. node , tcx)
134
+ decoder:: get_impl_or_trait_item ( tcx. sess . cstore . intr . clone ( ) ,
135
+ & * cdata,
136
+ def. node ,
137
+ tcx)
133
138
}
134
139
135
- pub fn get_method_name_and_explicit_self ( cstore : & cstore:: CStore ,
136
- def : ast:: DefId )
137
- -> ( ast:: Ident ,
138
- ty:: ExplicitSelfCategory )
139
- {
140
+ pub fn get_trait_item_name_and_kind ( cstore : & cstore:: CStore , def : ast:: DefId )
141
+ -> ( ast:: Ident , resolve:: TraitItemKind ) {
140
142
let cdata = cstore. get_crate_data ( def. krate ) ;
141
- decoder:: get_method_name_and_explicit_self ( cstore. intr . clone ( ) , & * cdata, def. node )
143
+ decoder:: get_trait_item_name_and_kind ( cstore. intr . clone ( ) ,
144
+ & * cdata,
145
+ def. node )
142
146
}
143
147
144
- pub fn get_trait_method_def_ids ( cstore : & cstore:: CStore ,
145
- def : ast :: DefId ) -> Vec < ast :: DefId > {
148
+ pub fn get_trait_item_def_ids ( cstore : & cstore:: CStore , def : ast :: DefId )
149
+ -> Vec < ty :: ImplOrTraitItemId > {
146
150
let cdata = cstore. get_crate_data ( def. krate ) ;
147
- decoder:: get_trait_method_def_ids ( & * cdata, def. node )
151
+ decoder:: get_trait_item_def_ids ( & * cdata, def. node )
148
152
}
149
153
150
154
pub fn get_item_variances ( cstore : & cstore:: CStore ,
@@ -286,15 +290,15 @@ pub fn each_implementation_for_trait(cstore: &cstore::CStore,
286
290
decoder:: each_implementation_for_trait ( & * cdata, def_id. node , callback)
287
291
}
288
292
289
- /// If the given def ID describes a method belonging to a trait (either a
293
+ /// If the given def ID describes an item belonging to a trait (either a
290
294
/// default method or an implementation of a trait method), returns the ID of
291
295
/// the trait that the method belongs to. Otherwise, returns `None`.
292
- pub fn get_trait_of_method ( cstore : & cstore:: CStore ,
293
- def_id : ast:: DefId ,
294
- tcx : & ty:: ctxt )
295
- -> Option < ast:: DefId > {
296
+ pub fn get_trait_of_item ( cstore : & cstore:: CStore ,
297
+ def_id : ast:: DefId ,
298
+ tcx : & ty:: ctxt )
299
+ -> Option < ast:: DefId > {
296
300
let cdata = cstore. get_crate_data ( def_id. krate ) ;
297
- decoder:: get_trait_of_method ( & * cdata, def_id. node , tcx)
301
+ decoder:: get_trait_of_item ( & * cdata, def_id. node , tcx)
298
302
}
299
303
300
304
pub fn get_tuple_struct_definition_if_ctor ( cstore : & cstore:: CStore ,
0 commit comments