@@ -224,39 +224,44 @@ fn variant_disr_val(d: rbml::Doc) -> Option<ty::Disr> {
224
224
} )
225
225
}
226
226
227
- fn doc_type ( doc : rbml:: Doc , tcx : & ty:: ctxt , cdata : Cmd ) -> Ty {
227
+ fn doc_type < ' tcx > ( doc : rbml:: Doc , tcx : & ty:: ctxt < ' tcx > , cdata : Cmd ) -> Ty < ' tcx > {
228
228
let tp = reader:: get_doc ( doc, tag_items_data_item_type) ;
229
229
parse_ty_data ( tp. data , cdata. cnum , tp. start , tcx,
230
230
|_, did| translate_def_id ( cdata, did) )
231
231
}
232
232
233
- fn doc_method_fty ( doc : rbml:: Doc , tcx : & ty:: ctxt , cdata : Cmd ) -> ty:: BareFnTy {
233
+ fn doc_method_fty < ' tcx > ( doc : rbml:: Doc , tcx : & ty:: ctxt < ' tcx > ,
234
+ cdata : Cmd ) -> ty:: BareFnTy < ' tcx > {
234
235
let tp = reader:: get_doc ( doc, tag_item_method_fty) ;
235
236
parse_bare_fn_ty_data ( tp. data , cdata. cnum , tp. start , tcx,
236
237
|_, did| translate_def_id ( cdata, did) )
237
238
}
238
239
239
- pub fn item_type ( _item_id : ast:: DefId , item : rbml:: Doc ,
240
- tcx : & ty:: ctxt , cdata : Cmd ) -> Ty {
240
+ pub fn item_type < ' tcx > ( _item_id : ast:: DefId , item : rbml:: Doc ,
241
+ tcx : & ty:: ctxt < ' tcx > , cdata : Cmd ) -> Ty < ' tcx > {
241
242
doc_type ( item, tcx, cdata)
242
243
}
243
244
244
- fn doc_trait_ref ( doc : rbml:: Doc , tcx : & ty:: ctxt , cdata : Cmd ) -> ty:: TraitRef {
245
+ fn doc_trait_ref < ' tcx > ( doc : rbml:: Doc , tcx : & ty:: ctxt < ' tcx > , cdata : Cmd )
246
+ -> ty:: TraitRef < ' tcx > {
245
247
parse_trait_ref_data ( doc. data , cdata. cnum , doc. start , tcx,
246
248
|_, did| translate_def_id ( cdata, did) )
247
249
}
248
250
249
- fn item_trait_ref ( doc : rbml:: Doc , tcx : & ty:: ctxt , cdata : Cmd ) -> ty:: TraitRef {
251
+ fn item_trait_ref < ' tcx > ( doc : rbml:: Doc , tcx : & ty:: ctxt < ' tcx > , cdata : Cmd )
252
+ -> ty:: TraitRef < ' tcx > {
250
253
let tp = reader:: get_doc ( doc, tag_item_trait_ref) ;
251
254
doc_trait_ref ( tp, tcx, cdata)
252
255
}
253
256
254
- fn doc_bounds ( doc : rbml:: Doc , tcx : & ty:: ctxt , cdata : Cmd ) -> ty:: ParamBounds {
257
+ fn doc_bounds < ' tcx > ( doc : rbml:: Doc , tcx : & ty:: ctxt < ' tcx > , cdata : Cmd )
258
+ -> ty:: ParamBounds < ' tcx > {
255
259
parse_bounds_data ( doc. data , cdata. cnum , doc. start , tcx,
256
260
|_, did| translate_def_id ( cdata, did) )
257
261
}
258
262
259
- fn trait_def_bounds ( doc : rbml:: Doc , tcx : & ty:: ctxt , cdata : Cmd ) -> ty:: ParamBounds {
263
+ fn trait_def_bounds < ' tcx > ( doc : rbml:: Doc , tcx : & ty:: ctxt < ' tcx > , cdata : Cmd )
264
+ -> ty:: ParamBounds < ' tcx > {
260
265
let d = reader:: get_doc ( doc, tag_trait_def_bounds) ;
261
266
doc_bounds ( d, tcx, cdata)
262
267
}
@@ -353,9 +358,9 @@ fn item_to_def_like(item: rbml::Doc, did: ast::DefId, cnum: ast::CrateNum)
353
358
}
354
359
}
355
360
356
- pub fn get_trait_def ( cdata : Cmd ,
357
- item_id : ast:: NodeId ,
358
- tcx : & ty:: ctxt ) -> ty:: TraitDef
361
+ pub fn get_trait_def < ' tcx > ( cdata : Cmd ,
362
+ item_id : ast:: NodeId ,
363
+ tcx : & ty:: ctxt < ' tcx > ) -> ty:: TraitDef < ' tcx >
359
364
{
360
365
let item_doc = lookup_item ( item_id, cdata. data ( ) ) ;
361
366
let generics = doc_generics ( item_doc, tcx, cdata, tag_item_generics) ;
@@ -368,8 +373,8 @@ pub fn get_trait_def(cdata: Cmd,
368
373
}
369
374
}
370
375
371
- pub fn get_type ( cdata : Cmd , id : ast:: NodeId , tcx : & ty:: ctxt )
372
- -> ty:: Polytype {
376
+ pub fn get_type < ' tcx > ( cdata : Cmd , id : ast:: NodeId , tcx : & ty:: ctxt < ' tcx > )
377
+ -> ty:: Polytype < ' tcx > {
373
378
374
379
let item = lookup_item ( id, cdata. data ( ) ) ;
375
380
@@ -403,20 +408,21 @@ pub fn get_repr_attrs(cdata: Cmd, id: ast::NodeId) -> Vec<attr::ReprAttr> {
403
408
}
404
409
}
405
410
406
- pub fn get_impl_trait ( cdata : Cmd ,
407
- id : ast:: NodeId ,
408
- tcx : & ty:: ctxt ) -> Option < Rc < ty:: TraitRef > >
411
+ pub fn get_impl_trait < ' tcx > ( cdata : Cmd ,
412
+ id : ast:: NodeId ,
413
+ tcx : & ty:: ctxt < ' tcx > )
414
+ -> Option < Rc < ty:: TraitRef < ' tcx > > >
409
415
{
410
416
let item_doc = lookup_item ( id, cdata. data ( ) ) ;
411
417
reader:: maybe_get_doc ( item_doc, tag_item_trait_ref) . map ( |tp| {
412
418
Rc :: new ( doc_trait_ref ( tp, tcx, cdata) )
413
419
} )
414
420
}
415
421
416
- pub fn get_impl_vtables ( cdata : Cmd ,
417
- id : ast:: NodeId ,
418
- tcx : & ty:: ctxt )
419
- -> typeck:: vtable_res
422
+ pub fn get_impl_vtables < ' tcx > ( cdata : Cmd ,
423
+ id : ast:: NodeId ,
424
+ tcx : & ty:: ctxt < ' tcx > )
425
+ -> typeck:: vtable_res < ' tcx >
420
426
{
421
427
let item_doc = lookup_item ( id, cdata. data ( ) ) ;
422
428
let vtables_doc = reader:: get_doc ( item_doc, tag_item_impl_vtables) ;
@@ -682,8 +688,8 @@ pub fn get_enum_variant_defs(intr: &IdentInterner,
682
688
} ) . collect ( )
683
689
}
684
690
685
- pub fn get_enum_variants ( intr : Rc < IdentInterner > , cdata : Cmd , id : ast:: NodeId ,
686
- tcx : & ty:: ctxt ) -> Vec < Rc < ty:: VariantInfo > > {
691
+ pub fn get_enum_variants < ' tcx > ( intr : Rc < IdentInterner > , cdata : Cmd , id : ast:: NodeId ,
692
+ tcx : & ty:: ctxt < ' tcx > ) -> Vec < Rc < ty:: VariantInfo < ' tcx > > > {
687
693
let data = cdata. data ( ) ;
688
694
let items = reader:: get_doc ( rbml:: Doc :: new ( data) , tag_items) ;
689
695
let item = find_item ( id, items) ;
@@ -786,11 +792,11 @@ pub fn get_trait_item_name_and_kind(intr: Rc<IdentInterner>,
786
792
}
787
793
}
788
794
789
- pub fn get_impl_or_trait_item ( intr : Rc < IdentInterner > ,
790
- cdata : Cmd ,
791
- id : ast:: NodeId ,
792
- tcx : & ty:: ctxt )
793
- -> ty:: ImplOrTraitItem {
795
+ pub fn get_impl_or_trait_item < ' tcx > ( intr : Rc < IdentInterner > ,
796
+ cdata : Cmd ,
797
+ id : ast:: NodeId ,
798
+ tcx : & ty:: ctxt < ' tcx > )
799
+ -> ty:: ImplOrTraitItem < ' tcx > {
794
800
let method_doc = lookup_item ( id, cdata. data ( ) ) ;
795
801
796
802
let def_id = item_def_id ( method_doc, cdata) ;
@@ -860,11 +866,11 @@ pub fn get_item_variances(cdata: Cmd, id: ast::NodeId) -> ty::ItemVariances {
860
866
Decodable :: decode ( & mut decoder) . unwrap ( )
861
867
}
862
868
863
- pub fn get_provided_trait_methods ( intr : Rc < IdentInterner > ,
864
- cdata : Cmd ,
865
- id : ast:: NodeId ,
866
- tcx : & ty:: ctxt )
867
- -> Vec < Rc < ty:: Method > > {
869
+ pub fn get_provided_trait_methods < ' tcx > ( intr : Rc < IdentInterner > ,
870
+ cdata : Cmd ,
871
+ id : ast:: NodeId ,
872
+ tcx : & ty:: ctxt < ' tcx > )
873
+ -> Vec < Rc < ty:: Method < ' tcx > > > {
868
874
let data = cdata. data ( ) ;
869
875
let item = lookup_item ( id, data) ;
870
876
let mut result = Vec :: new ( ) ;
@@ -892,8 +898,8 @@ pub fn get_provided_trait_methods(intr: Rc<IdentInterner>,
892
898
}
893
899
894
900
/// Returns the supertraits of the given trait.
895
- pub fn get_supertraits ( cdata : Cmd , id : ast:: NodeId , tcx : & ty:: ctxt )
896
- -> Vec < Rc < ty:: TraitRef > > {
901
+ pub fn get_supertraits < ' tcx > ( cdata : Cmd , id : ast:: NodeId , tcx : & ty:: ctxt < ' tcx > )
902
+ -> Vec < Rc < ty:: TraitRef < ' tcx > > > {
897
903
let mut results = Vec :: new ( ) ;
898
904
let item_doc = lookup_item ( id, cdata. data ( ) ) ;
899
905
reader:: tagged_docs ( item_doc, tag_item_super_trait_ref, |trait_doc| {
@@ -1388,11 +1394,11 @@ pub fn is_typedef(cdata: Cmd, id: ast::NodeId) -> bool {
1388
1394
}
1389
1395
}
1390
1396
1391
- fn doc_generics ( base_doc : rbml:: Doc ,
1392
- tcx : & ty:: ctxt ,
1393
- cdata : Cmd ,
1394
- tag : uint )
1395
- -> ty:: Generics
1397
+ fn doc_generics < ' tcx > ( base_doc : rbml:: Doc ,
1398
+ tcx : & ty:: ctxt < ' tcx > ,
1399
+ cdata : Cmd ,
1400
+ tag : uint )
1401
+ -> ty:: Generics < ' tcx >
1396
1402
{
1397
1403
let doc = reader:: get_doc ( base_doc, tag) ;
1398
1404
0 commit comments