@@ -22,9 +22,8 @@ use metadata::csearch::MethodInfo;
22
22
use metadata:: csearch;
23
23
use metadata:: cstore;
24
24
use metadata:: tydecode:: { parse_ty_data, parse_region_data, parse_def_id,
25
- parse_type_param_def_data, parse_bounds_data,
26
- parse_bare_fn_ty_data, parse_trait_ref_data,
27
- parse_predicate_data} ;
25
+ parse_type_param_def_data, parse_bare_fn_ty_data,
26
+ parse_trait_ref_data, parse_predicate_data} ;
28
27
use middle:: def;
29
28
use middle:: lang_items;
30
29
use middle:: subst;
@@ -260,18 +259,6 @@ fn item_trait_ref<'tcx>(doc: rbml::Doc, tcx: &ty::ctxt<'tcx>, cdata: Cmd)
260
259
doc_trait_ref ( tp, tcx, cdata)
261
260
}
262
261
263
- fn doc_bounds < ' tcx > ( doc : rbml:: Doc , tcx : & ty:: ctxt < ' tcx > , cdata : Cmd )
264
- -> ty:: ParamBounds < ' tcx > {
265
- parse_bounds_data ( doc. data , cdata. cnum , doc. start , tcx,
266
- |_, did| translate_def_id ( cdata, did) )
267
- }
268
-
269
- fn trait_def_bounds < ' tcx > ( doc : rbml:: Doc , tcx : & ty:: ctxt < ' tcx > , cdata : Cmd )
270
- -> ty:: ParamBounds < ' tcx > {
271
- let d = reader:: get_doc ( doc, tag_trait_def_bounds) ;
272
- doc_bounds ( d, tcx, cdata)
273
- }
274
-
275
262
fn enum_variant_ids ( item : rbml:: Doc , cdata : Cmd ) -> Vec < ast:: DefId > {
276
263
let mut ids: Vec < ast:: DefId > = Vec :: new ( ) ;
277
264
let v = tag_items_data_item_variant;
@@ -406,7 +393,6 @@ pub fn get_trait_def<'tcx>(cdata: Cmd,
406
393
{
407
394
let item_doc = lookup_item ( item_id, cdata. data ( ) ) ;
408
395
let generics = doc_generics ( item_doc, tcx, cdata, tag_item_generics) ;
409
- let bounds = trait_def_bounds ( item_doc, tcx, cdata) ;
410
396
let unsafety = parse_unsafety ( item_doc) ;
411
397
let associated_type_names = parse_associated_type_names ( item_doc) ;
412
398
let paren_sugar = parse_paren_sugar ( item_doc) ;
@@ -415,7 +401,6 @@ pub fn get_trait_def<'tcx>(cdata: Cmd,
415
401
paren_sugar : paren_sugar,
416
402
unsafety : unsafety,
417
403
generics : generics,
418
- bounds : bounds,
419
404
trait_ref : item_trait_ref ( item_doc, tcx, cdata) ,
420
405
associated_type_names : associated_type_names,
421
406
}
@@ -430,6 +415,15 @@ pub fn get_predicates<'tcx>(cdata: Cmd,
430
415
doc_predicates ( item_doc, tcx, cdata, tag_item_generics)
431
416
}
432
417
418
+ pub fn get_super_predicates < ' tcx > ( cdata : Cmd ,
419
+ item_id : ast:: NodeId ,
420
+ tcx : & ty:: ctxt < ' tcx > )
421
+ -> ty:: GenericPredicates < ' tcx >
422
+ {
423
+ let item_doc = lookup_item ( item_id, cdata. data ( ) ) ;
424
+ doc_predicates ( item_doc, tcx, cdata, tag_item_super_predicates)
425
+ }
426
+
433
427
pub fn get_type < ' tcx > ( cdata : Cmd , id : ast:: NodeId , tcx : & ty:: ctxt < ' tcx > )
434
428
-> ty:: TypeScheme < ' tcx >
435
429
{
@@ -971,24 +965,6 @@ pub fn get_provided_trait_methods<'tcx>(intr: Rc<IdentInterner>,
971
965
return result;
972
966
}
973
967
974
- /// Returns the supertraits of the given trait.
975
- pub fn get_supertraits < ' tcx > ( cdata : Cmd , id : ast:: NodeId , tcx : & ty:: ctxt < ' tcx > )
976
- -> Vec < Rc < ty:: TraitRef < ' tcx > > > {
977
- let mut results = Vec :: new ( ) ;
978
- let item_doc = lookup_item ( id, cdata. data ( ) ) ;
979
- reader:: tagged_docs ( item_doc, tag_item_super_trait_ref, |trait_doc| {
980
- // NB. Only reads the ones that *aren't* builtin-bounds. See also
981
- // get_trait_def() for collecting the builtin bounds.
982
- // FIXME(#8559): The builtin bounds shouldn't be encoded in the first place.
983
- let trait_ref = doc_trait_ref ( trait_doc, tcx, cdata) ;
984
- if tcx. lang_items . to_builtin_kind ( trait_ref. def_id ) . is_none ( ) {
985
- results. push ( trait_ref) ;
986
- }
987
- true
988
- } ) ;
989
- return results;
990
- }
991
-
992
968
pub fn get_type_name_if_impl ( cdata : Cmd ,
993
969
node_id : ast:: NodeId ) -> Option < ast:: Name > {
994
970
let item = lookup_item ( node_id, cdata. data ( ) ) ;
0 commit comments