@@ -35,8 +35,8 @@ pub(crate) fn target_from_impl_item<'tcx>(
3535 match impl_item. kind {
3636 hir:: ImplItemKind :: Const ( ..) => Target :: AssocConst ,
3737 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 ) ;
4040 let containing_impl_is_for_trait = match & containing_item. kind {
4141 hir:: ItemKind :: Impl ( impl_) => impl_. of_trait . is_some ( ) ,
4242 _ => bug ! ( "parent of an ImplItem must be an Impl" ) ,
@@ -640,17 +640,17 @@ impl CheckAttrVisitor<'_> {
640640 let span = meta. span ( ) ;
641641 if let Some ( location) = match target {
642642 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 ) ;
645645 if Target :: from_item ( containing_item) == Target :: Impl {
646646 Some ( "type alias in implementation block" )
647647 } else {
648648 None
649649 }
650650 }
651651 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 ) ;
654654 // We can't link to trait impl's consts.
655655 let err = "associated constant in trait implementation block" ;
656656 match containing_item. kind {
0 commit comments