@@ -616,7 +616,7 @@ impl EncodeContext<'tcx> {
616616 ctor : variant. ctor_def_id . map ( |did| did. index ) ,
617617 } ;
618618
619- let enum_id = tcx. hir ( ) . as_local_hir_id ( def. did . expect_local ( ) ) . unwrap ( ) ;
619+ let enum_id = tcx. hir ( ) . as_local_hir_id ( def. did . expect_local ( ) ) ;
620620 let enum_vis = & tcx. hir ( ) . expect_item ( enum_id) . vis ;
621621
622622 record ! ( self . tables. kind[ def_id] <- EntryKind :: Variant ( self . lazy( data) ) ) ;
@@ -662,7 +662,7 @@ impl EncodeContext<'tcx> {
662662
663663 // Variant constructors have the same visibility as the parent enums, unless marked as
664664 // non-exhaustive, in which case they are lowered to `pub(crate)`.
665- let enum_id = tcx. hir ( ) . as_local_hir_id ( def. did . expect_local ( ) ) . unwrap ( ) ;
665+ let enum_id = tcx. hir ( ) . as_local_hir_id ( def. did . expect_local ( ) ) ;
666666 let enum_vis = & tcx. hir ( ) . expect_item ( enum_id) . vis ;
667667 let mut ctor_vis = ty:: Visibility :: from_hir ( enum_vis, enum_id, tcx) ;
668668 if variant. is_field_list_non_exhaustive ( ) && ctor_vis == ty:: Visibility :: Public {
@@ -728,7 +728,7 @@ impl EncodeContext<'tcx> {
728728 let def_id = field. did ;
729729 debug ! ( "EncodeContext::encode_field({:?})" , def_id) ;
730730
731- let variant_id = tcx. hir ( ) . as_local_hir_id ( variant. def_id . expect_local ( ) ) . unwrap ( ) ;
731+ let variant_id = tcx. hir ( ) . as_local_hir_id ( variant. def_id . expect_local ( ) ) ;
732732 let variant_data = tcx. hir ( ) . expect_variant_data ( variant_id) ;
733733
734734 record ! ( self . tables. kind[ def_id] <- EntryKind :: Field ) ;
@@ -755,7 +755,7 @@ impl EncodeContext<'tcx> {
755755 ctor : Some ( def_id. index ) ,
756756 } ;
757757
758- let struct_id = tcx. hir ( ) . as_local_hir_id ( adt_def. did . expect_local ( ) ) . unwrap ( ) ;
758+ let struct_id = tcx. hir ( ) . as_local_hir_id ( adt_def. did . expect_local ( ) ) ;
759759 let struct_vis = & tcx. hir ( ) . expect_item ( struct_id) . vis ;
760760 let mut ctor_vis = ty:: Visibility :: from_hir ( struct_vis, struct_id, tcx) ;
761761 for field in & variant. fields {
@@ -817,7 +817,7 @@ impl EncodeContext<'tcx> {
817817 debug ! ( "EncodeContext::encode_info_for_trait_item({:?})" , def_id) ;
818818 let tcx = self . tcx ;
819819
820- let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id. expect_local ( ) ) . unwrap ( ) ;
820+ let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id. expect_local ( ) ) ;
821821 let ast_item = tcx. hir ( ) . expect_trait_item ( hir_id) ;
822822 let trait_item = tcx. associated_item ( def_id) ;
823823
@@ -908,7 +908,7 @@ impl EncodeContext<'tcx> {
908908 debug ! ( "EncodeContext::encode_info_for_impl_item({:?})" , def_id) ;
909909 let tcx = self . tcx ;
910910
911- let hir_id = self . tcx . hir ( ) . as_local_hir_id ( def_id. expect_local ( ) ) . unwrap ( ) ;
911+ let hir_id = self . tcx . hir ( ) . as_local_hir_id ( def_id. expect_local ( ) ) ;
912912 let ast_item = self . tcx . hir ( ) . expect_impl_item ( hir_id) ;
913913 let impl_item = self . tcx . associated_item ( def_id) ;
914914
@@ -1312,7 +1312,7 @@ impl EncodeContext<'tcx> {
13121312
13131313 // NOTE(eddyb) `tcx.type_of(def_id)` isn't used because it's fully generic,
13141314 // including on the signature, which is inferred in `typeck_tables_of.
1315- let hir_id = self . tcx . hir ( ) . as_local_hir_id ( def_id) . unwrap ( ) ;
1315+ let hir_id = self . tcx . hir ( ) . as_local_hir_id ( def_id) ;
13161316 let ty = self . tcx . typeck_tables_of ( def_id) . node_type ( hir_id) ;
13171317
13181318 let def_id = def_id. to_def_id ( ) ;
@@ -1340,7 +1340,7 @@ impl EncodeContext<'tcx> {
13401340
13411341 fn encode_info_for_anon_const ( & mut self , def_id : LocalDefId ) {
13421342 debug ! ( "EncodeContext::encode_info_for_anon_const({:?})" , def_id) ;
1343- let id = self . tcx . hir ( ) . as_local_hir_id ( def_id) . unwrap ( ) ;
1343+ let id = self . tcx . hir ( ) . as_local_hir_id ( def_id) ;
13441344 let body_id = self . tcx . hir ( ) . body_owned_by ( id) ;
13451345 let const_data = self . encode_rendered_const_for_body ( body_id) ;
13461346 let def_id = def_id. to_def_id ( ) ;
0 commit comments