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