@@ -436,7 +436,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
436
436
// If the trait is private, add the impl items to `private_traits` so they don't get
437
437
// reported for missing docs.
438
438
let real_trait = trait_ref. path . res . def_id ( ) ;
439
- if let Some ( hir_id) = cx. tcx . hir ( ) . as_local_hir_id ( real_trait) {
439
+ if let Some ( def_id) = real_trait. as_local ( ) {
440
+ let hir_id = cx. tcx . hir ( ) . as_local_hir_id ( def_id) ;
440
441
if let Some ( Node :: Item ( item) ) = cx. tcx . hir ( ) . find ( hir_id) {
441
442
if let hir:: VisibilityKind :: Inherited = item. vis . node {
442
443
for impl_item_ref in items {
@@ -461,7 +462,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
461
462
} ;
462
463
463
464
let def_id = cx. tcx . hir ( ) . local_def_id ( it. hir_id ) ;
464
- let ( article, desc) = cx. tcx . article_and_description ( def_id) ;
465
+ let ( article, desc) = cx. tcx . article_and_description ( def_id. to_def_id ( ) ) ;
465
466
466
467
self . check_missing_docs_attrs ( cx, Some ( it. hir_id ) , & it. attrs , it. span , article, desc) ;
467
468
}
@@ -472,7 +473,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
472
473
}
473
474
474
475
let def_id = cx. tcx . hir ( ) . local_def_id ( trait_item. hir_id ) ;
475
- let ( article, desc) = cx. tcx . article_and_description ( def_id) ;
476
+ let ( article, desc) = cx. tcx . article_and_description ( def_id. to_def_id ( ) ) ;
476
477
477
478
self . check_missing_docs_attrs (
478
479
cx,
@@ -491,7 +492,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
491
492
}
492
493
493
494
let def_id = cx. tcx . hir ( ) . local_def_id ( impl_item. hir_id ) ;
494
- let ( article, desc) = cx. tcx . article_and_description ( def_id) ;
495
+ let ( article, desc) = cx. tcx . article_and_description ( def_id. to_def_id ( ) ) ;
495
496
self . check_missing_docs_attrs (
496
497
cx,
497
498
Some ( impl_item. hir_id ) ,
@@ -609,8 +610,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDebugImplementations {
609
610
let mut impls = HirIdSet :: default ( ) ;
610
611
cx. tcx . for_each_impl ( debug, |d| {
611
612
if let Some ( ty_def) = cx. tcx . type_of ( d) . ty_adt_def ( ) {
612
- if let Some ( hir_id ) = cx . tcx . hir ( ) . as_local_hir_id ( ty_def. did ) {
613
- impls. insert ( hir_id ) ;
613
+ if let Some ( def_id ) = ty_def. did . as_local ( ) {
614
+ impls. insert ( cx . tcx . hir ( ) . as_local_hir_id ( def_id ) ) ;
614
615
}
615
616
}
616
617
} ) ;
@@ -1531,7 +1532,8 @@ impl ExplicitOutlivesRequirements {
1531
1532
inferred_outlives : & ' tcx [ ( ty:: Predicate < ' tcx > , Span ) ] ,
1532
1533
ty_generics : & ' tcx ty:: Generics ,
1533
1534
) -> Vec < ty:: Region < ' tcx > > {
1534
- let index = ty_generics. param_def_id_to_index [ & tcx. hir ( ) . local_def_id ( param. hir_id ) ] ;
1535
+ let index =
1536
+ ty_generics. param_def_id_to_index [ & tcx. hir ( ) . local_def_id ( param. hir_id ) . to_def_id ( ) ] ;
1535
1537
1536
1538
match param. kind {
1537
1539
hir:: GenericParamKind :: Lifetime { .. } => {
0 commit comments