@@ -617,7 +617,7 @@ impl EncodeContext<'tcx> {
617617 ctor : variant. ctor_def_id . map ( |did| did. index ) ,
618618 } ;
619619
620- let enum_id = tcx. hir ( ) . as_local_hir_id ( def. did . expect_local ( ) ) . unwrap ( ) ;
620+ let enum_id = tcx. hir ( ) . as_local_hir_id ( def. did . expect_local ( ) ) ;
621621 let enum_vis = & tcx. hir ( ) . expect_item ( enum_id) . vis ;
622622
623623 record ! ( self . tables. kind[ def_id] <- EntryKind :: Variant ( self . lazy( data) ) ) ;
@@ -663,7 +663,7 @@ impl EncodeContext<'tcx> {
663663
664664 // Variant constructors have the same visibility as the parent enums, unless marked as
665665 // non-exhaustive, in which case they are lowered to `pub(crate)`.
666- let enum_id = tcx. hir ( ) . as_local_hir_id ( def. did . expect_local ( ) ) . unwrap ( ) ;
666+ let enum_id = tcx. hir ( ) . as_local_hir_id ( def. did . expect_local ( ) ) ;
667667 let enum_vis = & tcx. hir ( ) . expect_item ( enum_id) . vis ;
668668 let mut ctor_vis = ty:: Visibility :: from_hir ( enum_vis, enum_id, tcx) ;
669669 if variant. is_field_list_non_exhaustive ( ) && ctor_vis == ty:: Visibility :: Public {
@@ -729,7 +729,7 @@ impl EncodeContext<'tcx> {
729729 let def_id = field. did ;
730730 debug ! ( "EncodeContext::encode_field({:?})" , def_id) ;
731731
732- let variant_id = tcx. hir ( ) . as_local_hir_id ( variant. def_id . expect_local ( ) ) . unwrap ( ) ;
732+ let variant_id = tcx. hir ( ) . as_local_hir_id ( variant. def_id . expect_local ( ) ) ;
733733 let variant_data = tcx. hir ( ) . expect_variant_data ( variant_id) ;
734734
735735 record ! ( self . tables. kind[ def_id] <- EntryKind :: Field ) ;
@@ -756,7 +756,7 @@ impl EncodeContext<'tcx> {
756756 ctor : Some ( def_id. index ) ,
757757 } ;
758758
759- let struct_id = tcx. hir ( ) . as_local_hir_id ( adt_def. did . expect_local ( ) ) . unwrap ( ) ;
759+ let struct_id = tcx. hir ( ) . as_local_hir_id ( adt_def. did . expect_local ( ) ) ;
760760 let struct_vis = & tcx. hir ( ) . expect_item ( struct_id) . vis ;
761761 let mut ctor_vis = ty:: Visibility :: from_hir ( struct_vis, struct_id, tcx) ;
762762 for field in & variant. fields {
@@ -818,7 +818,7 @@ impl EncodeContext<'tcx> {
818818 debug ! ( "EncodeContext::encode_info_for_trait_item({:?})" , def_id) ;
819819 let tcx = self . tcx ;
820820
821- let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id. expect_local ( ) ) . unwrap ( ) ;
821+ let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id. expect_local ( ) ) ;
822822 let ast_item = tcx. hir ( ) . expect_trait_item ( hir_id) ;
823823 let trait_item = tcx. associated_item ( def_id) ;
824824
@@ -909,7 +909,7 @@ impl EncodeContext<'tcx> {
909909 debug ! ( "EncodeContext::encode_info_for_impl_item({:?})" , def_id) ;
910910 let tcx = self . tcx ;
911911
912- let hir_id = self . tcx . hir ( ) . as_local_hir_id ( def_id. expect_local ( ) ) . unwrap ( ) ;
912+ let hir_id = self . tcx . hir ( ) . as_local_hir_id ( def_id. expect_local ( ) ) ;
913913 let ast_item = self . tcx . hir ( ) . expect_impl_item ( hir_id) ;
914914 let impl_item = self . tcx . associated_item ( def_id) ;
915915
@@ -1313,7 +1313,7 @@ impl EncodeContext<'tcx> {
13131313
13141314 // NOTE(eddyb) `tcx.type_of(def_id)` isn't used because it's fully generic,
13151315 // including on the signature, which is inferred in `typeck_tables_of.
1316- let hir_id = self . tcx . hir ( ) . as_local_hir_id ( def_id) . unwrap ( ) ;
1316+ let hir_id = self . tcx . hir ( ) . as_local_hir_id ( def_id) ;
13171317 let ty = self . tcx . typeck_tables_of ( def_id) . node_type ( hir_id) ;
13181318
13191319 let def_id = def_id. to_def_id ( ) ;
@@ -1341,7 +1341,7 @@ impl EncodeContext<'tcx> {
13411341
13421342 fn encode_info_for_anon_const ( & mut self , def_id : LocalDefId ) {
13431343 debug ! ( "EncodeContext::encode_info_for_anon_const({:?})" , def_id) ;
1344- let id = self . tcx . hir ( ) . as_local_hir_id ( def_id) . unwrap ( ) ;
1344+ let id = self . tcx . hir ( ) . as_local_hir_id ( def_id) ;
13451345 let body_id = self . tcx . hir ( ) . body_owned_by ( id) ;
13461346 let const_data = self . encode_rendered_const_for_body ( body_id) ;
13471347 let def_id = def_id. to_def_id ( ) ;
0 commit comments