@@ -35,8 +35,8 @@ pub(crate) fn target_from_impl_item<'tcx>(
35
35
match impl_item. kind {
36
36
hir:: ImplItemKind :: Const ( ..) => Target :: AssocConst ,
37
37
hir:: ImplItemKind :: Fn ( ..) => {
38
- let parent_hir_id = tcx. hir ( ) . get_parent_item ( impl_item. hir_id ( ) ) ;
39
- let containing_item = tcx. hir ( ) . expect_item ( parent_hir_id ) ;
38
+ let parent_def_id = tcx. hir ( ) . get_parent_item ( impl_item. hir_id ( ) ) ;
39
+ let containing_item = tcx. hir ( ) . expect_item ( parent_def_id ) ;
40
40
let containing_impl_is_for_trait = match & containing_item. kind {
41
41
hir:: ItemKind :: Impl ( impl_) => impl_. of_trait . is_some ( ) ,
42
42
_ => bug ! ( "parent of an ImplItem must be an Impl" ) ,
@@ -640,17 +640,17 @@ impl CheckAttrVisitor<'_> {
640
640
let span = meta. span ( ) ;
641
641
if let Some ( location) = match target {
642
642
Target :: AssocTy => {
643
- let parent_hir_id = self . tcx . hir ( ) . get_parent_item ( hir_id) ;
644
- let containing_item = self . tcx . hir ( ) . expect_item ( parent_hir_id ) ;
643
+ let parent_def_id = self . tcx . hir ( ) . get_parent_item ( hir_id) ;
644
+ let containing_item = self . tcx . hir ( ) . expect_item ( parent_def_id ) ;
645
645
if Target :: from_item ( containing_item) == Target :: Impl {
646
646
Some ( "type alias in implementation block" )
647
647
} else {
648
648
None
649
649
}
650
650
}
651
651
Target :: AssocConst => {
652
- let parent_hir_id = self . tcx . hir ( ) . get_parent_item ( hir_id) ;
653
- let containing_item = self . tcx . hir ( ) . expect_item ( parent_hir_id ) ;
652
+ let parent_def_id = self . tcx . hir ( ) . get_parent_item ( hir_id) ;
653
+ let containing_item = self . tcx . hir ( ) . expect_item ( parent_def_id ) ;
654
654
// We can't link to trait impl's consts.
655
655
let err = "associated constant in trait implementation block" ;
656
656
match containing_item. kind {
0 commit comments