@@ -111,12 +111,24 @@ pub fn get_impls_for_mod(cstore: @mut cstore::CStore, def: ast::def_id,
111111 }
112112}
113113
114- pub fn get_trait_methods ( tcx : ty:: ctxt ,
115- def : ast:: def_id )
116- -> @~[ ty:: method ] {
117- let cstore = tcx. cstore ;
114+ pub fn get_method ( tcx : ty:: ctxt ,
115+ def : ast:: def_id ) -> ty:: method
116+ {
117+ let cdata = cstore:: get_crate_data ( tcx. cstore , def. crate ) ;
118+ decoder:: get_method ( tcx. cstore . intr , cdata, def. node , tcx)
119+ }
120+
121+ pub fn get_method_name_and_self_ty ( cstore : @mut cstore:: CStore ,
122+ def : ast:: def_id ) -> ( ast:: ident , ast:: self_ty_ )
123+ {
124+ let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
125+ decoder:: get_method_name_and_self_ty ( cstore. intr , cdata, def. node )
126+ }
127+
128+ pub fn get_trait_method_def_ids ( cstore : @mut cstore:: CStore ,
129+ def : ast:: def_id ) -> ~[ ast:: def_id ] {
118130 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
119- decoder:: get_trait_methods ( cstore . intr , cdata, def. node , tcx )
131+ decoder:: get_trait_method_def_ids ( cdata, def. node )
120132}
121133
122134pub fn get_provided_trait_methods ( tcx : ty:: ctxt ,
@@ -127,19 +139,12 @@ pub fn get_provided_trait_methods(tcx: ty::ctxt,
127139 decoder:: get_provided_trait_methods ( cstore. intr , cdata, def. node , tcx)
128140}
129141
130- pub fn get_supertraits ( tcx : ty:: ctxt , def : ast:: def_id ) -> ~[ ty:: t ] {
142+ pub fn get_supertraits ( tcx : ty:: ctxt , def : ast:: def_id ) -> ~[ @ ty:: TraitRef ] {
131143 let cstore = tcx. cstore ;
132144 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
133145 decoder:: get_supertraits ( cdata, def. node , tcx)
134146}
135147
136- pub fn get_method_names_if_trait ( cstore : @mut cstore:: CStore ,
137- def : ast:: def_id )
138- -> Option < ~[ ( ast:: ident , ast:: self_ty_ ) ] > {
139- let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
140- return decoder:: get_method_names_if_trait ( cstore. intr , cdata, def. node ) ;
141- }
142-
143148pub fn get_type_name_if_impl ( cstore : @mut cstore:: CStore , def : ast:: def_id )
144149 -> Option < ast:: ident > {
145150 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
@@ -175,6 +180,12 @@ pub fn get_type(tcx: ty::ctxt,
175180 decoder:: get_type ( cdata, def. node , tcx)
176181}
177182
183+ pub fn get_trait_def ( tcx : ty:: ctxt , def : ast:: def_id ) -> ty:: TraitDef {
184+ let cstore = tcx. cstore ;
185+ let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
186+ decoder:: get_trait_def ( cdata, def. node , tcx)
187+ }
188+
178189pub fn get_region_param ( cstore : @mut metadata:: cstore:: CStore ,
179190 def : ast:: def_id ) -> Option < ty:: region_variance > {
180191 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
@@ -199,16 +210,17 @@ pub fn get_field_type(tcx: ty::ctxt, class_id: ast::def_id,
199210 debug ! ( "got field data %?" , the_field) ;
200211 let ty = decoder:: item_type ( def, the_field, tcx, cdata) ;
201212 ty:: ty_param_bounds_and_ty {
202- bounds : @~[ ] ,
203- region_param : None ,
213+ generics : ty :: Generics { bounds : @~[ ] ,
214+ region_param : None } ,
204215 ty : ty
205216 }
206217}
207218
208219// Given a def_id for an impl or class, return the traits it implements,
209220// or the empty vector if it's not for an impl or for a class that implements
210221// traits
211- pub fn get_impl_traits ( tcx : ty:: ctxt , def : ast:: def_id ) -> ~[ ty:: t ] {
222+ pub fn get_impl_traits ( tcx : ty:: ctxt ,
223+ def : ast:: def_id ) -> ~[ @ty:: TraitRef ] {
212224 let cstore = tcx. cstore ;
213225 let cdata = cstore:: get_crate_data ( cstore, def. crate ) ;
214226 decoder:: get_impl_traits ( cdata, def. node , tcx)
0 commit comments