@@ -500,7 +500,7 @@ impl MetadataBlob {
500
500
}
501
501
}
502
502
503
- impl < ' tcx > EntryKind < ' tcx > {
503
+ impl EntryKind {
504
504
fn def_kind ( & self ) -> Option < DefKind > {
505
505
Some ( match * self {
506
506
EntryKind :: Const ( ..) => DefKind :: Const ,
@@ -614,11 +614,11 @@ impl<'a, 'tcx> CrateMetadata {
614
614
self . root . proc_macro_data . and_then ( |data| data. decode ( self ) . find ( |x| * x == id) ) . is_some ( )
615
615
}
616
616
617
- fn maybe_kind ( & self , item_id : DefIndex ) -> Option < EntryKind < ' tcx > > {
617
+ fn maybe_kind ( & self , item_id : DefIndex ) -> Option < EntryKind > {
618
618
self . root . per_def . kind . get ( self , item_id) . map ( |k| k. decode ( self ) )
619
619
}
620
620
621
- fn kind ( & self , item_id : DefIndex ) -> EntryKind < ' tcx > {
621
+ fn kind ( & self , item_id : DefIndex ) -> EntryKind {
622
622
assert ! ( !self . is_proc_macro( item_id) ) ;
623
623
self . maybe_kind ( item_id) . unwrap_or_else ( || {
624
624
bug ! (
@@ -723,7 +723,7 @@ impl<'a, 'tcx> CrateMetadata {
723
723
fn get_variant (
724
724
& self ,
725
725
tcx : TyCtxt < ' tcx > ,
726
- kind : & EntryKind < ' _ > ,
726
+ kind : & EntryKind ,
727
727
index : DefIndex ,
728
728
parent_did : DefId ,
729
729
) -> ty:: VariantDef {
@@ -1390,6 +1390,13 @@ impl<'a, 'tcx> CrateMetadata {
1390
1390
}
1391
1391
}
1392
1392
1393
+ fn generator_kind ( & self , id : DefIndex ) -> Option < hir:: GeneratorKind > {
1394
+ match self . kind ( id) {
1395
+ EntryKind :: Generator ( data) => Some ( data. decode ( self ) ) ,
1396
+ _ => None ,
1397
+ }
1398
+ }
1399
+
1393
1400
fn fn_sig ( & self , id : DefIndex , tcx : TyCtxt < ' tcx > ) -> ty:: PolyFnSig < ' tcx > {
1394
1401
self . root . per_def . fn_sig . get ( self , id) . unwrap ( ) . decode ( ( self , tcx) )
1395
1402
}
@@ -1499,8 +1506,8 @@ impl<'a, 'tcx> CrateMetadata {
1499
1506
) ;
1500
1507
debug ! (
1501
1508
"CrateMetaData::imported_source_files alloc \
1502
- source_file {:?} original (start_pos {:?} end_pos {:?}) \
1503
- translated (start_pos {:?} end_pos {:?})",
1509
+ source_file {:?} original (start_pos {:?} end_pos {:?}) \
1510
+ translated (start_pos {:?} end_pos {:?})",
1504
1511
local_version. name,
1505
1512
start_pos,
1506
1513
end_pos,
0 commit comments