@@ -617,7 +617,7 @@ impl EncodeContext<'tcx> {
617
617
ctor : variant. ctor_def_id . map ( |did| did. index ) ,
618
618
} ;
619
619
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 ( ) ) ;
621
621
let enum_vis = & tcx. hir ( ) . expect_item ( enum_id) . vis ;
622
622
623
623
record ! ( self . tables. kind[ def_id] <- EntryKind :: Variant ( self . lazy( data) ) ) ;
@@ -663,7 +663,7 @@ impl EncodeContext<'tcx> {
663
663
664
664
// Variant constructors have the same visibility as the parent enums, unless marked as
665
665
// 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 ( ) ) ;
667
667
let enum_vis = & tcx. hir ( ) . expect_item ( enum_id) . vis ;
668
668
let mut ctor_vis = ty:: Visibility :: from_hir ( enum_vis, enum_id, tcx) ;
669
669
if variant. is_field_list_non_exhaustive ( ) && ctor_vis == ty:: Visibility :: Public {
@@ -729,7 +729,7 @@ impl EncodeContext<'tcx> {
729
729
let def_id = field. did ;
730
730
debug ! ( "EncodeContext::encode_field({:?})" , def_id) ;
731
731
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 ( ) ) ;
733
733
let variant_data = tcx. hir ( ) . expect_variant_data ( variant_id) ;
734
734
735
735
record ! ( self . tables. kind[ def_id] <- EntryKind :: Field ) ;
@@ -756,7 +756,7 @@ impl EncodeContext<'tcx> {
756
756
ctor : Some ( def_id. index ) ,
757
757
} ;
758
758
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 ( ) ) ;
760
760
let struct_vis = & tcx. hir ( ) . expect_item ( struct_id) . vis ;
761
761
let mut ctor_vis = ty:: Visibility :: from_hir ( struct_vis, struct_id, tcx) ;
762
762
for field in & variant. fields {
@@ -818,7 +818,7 @@ impl EncodeContext<'tcx> {
818
818
debug ! ( "EncodeContext::encode_info_for_trait_item({:?})" , def_id) ;
819
819
let tcx = self . tcx ;
820
820
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 ( ) ) ;
822
822
let ast_item = tcx. hir ( ) . expect_trait_item ( hir_id) ;
823
823
let trait_item = tcx. associated_item ( def_id) ;
824
824
@@ -909,7 +909,7 @@ impl EncodeContext<'tcx> {
909
909
debug ! ( "EncodeContext::encode_info_for_impl_item({:?})" , def_id) ;
910
910
let tcx = self . tcx ;
911
911
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 ( ) ) ;
913
913
let ast_item = self . tcx . hir ( ) . expect_impl_item ( hir_id) ;
914
914
let impl_item = self . tcx . associated_item ( def_id) ;
915
915
@@ -1313,7 +1313,7 @@ impl EncodeContext<'tcx> {
1313
1313
1314
1314
// NOTE(eddyb) `tcx.type_of(def_id)` isn't used because it's fully generic,
1315
1315
// 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) ;
1317
1317
let ty = self . tcx . typeck_tables_of ( def_id) . node_type ( hir_id) ;
1318
1318
1319
1319
let def_id = def_id. to_def_id ( ) ;
@@ -1341,7 +1341,7 @@ impl EncodeContext<'tcx> {
1341
1341
1342
1342
fn encode_info_for_anon_const ( & mut self , def_id : LocalDefId ) {
1343
1343
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) ;
1345
1345
let body_id = self . tcx . hir ( ) . body_owned_by ( id) ;
1346
1346
let const_data = self . encode_rendered_const_for_body ( body_id) ;
1347
1347
let def_id = def_id. to_def_id ( ) ;
0 commit comments