@@ -417,7 +417,7 @@ fn extract_spans_for_error_reporting<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a
417417 let tcx = infcx. tcx ;
418418 let impl_m_hir_id = tcx. hir ( ) . as_local_hir_id ( impl_m. def_id ) . unwrap ( ) ;
419419 let ( impl_m_output, impl_m_iter) = match tcx. hir ( )
420- . expect_impl_item_by_hir_id ( impl_m_hir_id)
420+ . expect_impl_item ( impl_m_hir_id)
421421 . node {
422422 ImplItemKind :: Method ( ref impl_m_sig, _) => {
423423 ( & impl_m_sig. decl . output , impl_m_sig. decl . inputs . iter ( ) )
@@ -429,7 +429,7 @@ fn extract_spans_for_error_reporting<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a
429429 TypeError :: Mutability => {
430430 if let Some ( trait_m_hir_id) = tcx. hir ( ) . as_local_hir_id ( trait_m. def_id ) {
431431 let trait_m_iter = match tcx. hir ( )
432- . expect_trait_item_by_hir_id ( trait_m_hir_id)
432+ . expect_trait_item ( trait_m_hir_id)
433433 . node {
434434 TraitItemKind :: Method ( ref trait_m_sig, _) => {
435435 trait_m_sig. decl . inputs . iter ( )
@@ -456,7 +456,7 @@ fn extract_spans_for_error_reporting<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a
456456 TypeError :: Sorts ( ExpectedFound { .. } ) => {
457457 if let Some ( trait_m_hir_id) = tcx. hir ( ) . as_local_hir_id ( trait_m. def_id ) {
458458 let ( trait_m_output, trait_m_iter) =
459- match tcx. hir ( ) . expect_trait_item_by_hir_id ( trait_m_hir_id) . node {
459+ match tcx. hir ( ) . expect_trait_item ( trait_m_hir_id) . node {
460460 TraitItemKind :: Method ( ref trait_m_sig, _) => {
461461 ( & trait_m_sig. decl . output , trait_m_sig. decl . inputs . iter ( ) )
462462 }
@@ -599,8 +599,8 @@ fn compare_number_of_generics<'a, 'tcx>(
599599 if impl_count != trait_count {
600600 err_occurred = true ;
601601
602- let impl_node_id = tcx. hir ( ) . as_local_node_id ( impl_. def_id ) . unwrap ( ) ;
603- let impl_item = tcx. hir ( ) . expect_impl_item ( impl_node_id ) ;
602+ let impl_hir_id = tcx. hir ( ) . as_local_hir_id ( impl_. def_id ) . unwrap ( ) ;
603+ let impl_item = tcx. hir ( ) . expect_impl_item ( impl_hir_id ) ;
604604 let span = if impl_item. generics . params . is_empty ( )
605605 || impl_item. generics . span . is_dummy ( ) { // argument position impl Trait (#55374)
606606 impl_span
@@ -666,7 +666,7 @@ fn compare_number_of_method_arguments<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
666666 if trait_number_args != impl_number_args {
667667 let trait_m_hir_id = tcx. hir ( ) . as_local_hir_id ( trait_m. def_id ) ;
668668 let trait_span = if let Some ( trait_id) = trait_m_hir_id {
669- match tcx. hir ( ) . expect_trait_item_by_hir_id ( trait_id) . node {
669+ match tcx. hir ( ) . expect_trait_item ( trait_id) . node {
670670 TraitItemKind :: Method ( ref trait_m_sig, _) => {
671671 let pos = if trait_number_args > 0 {
672672 trait_number_args - 1
@@ -691,7 +691,7 @@ fn compare_number_of_method_arguments<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
691691 trait_item_span
692692 } ;
693693 let impl_m_hir_id = tcx. hir ( ) . as_local_hir_id ( impl_m. def_id ) . unwrap ( ) ;
694- let impl_span = match tcx. hir ( ) . expect_impl_item_by_hir_id ( impl_m_hir_id) . node {
694+ let impl_span = match tcx. hir ( ) . expect_impl_item ( impl_m_hir_id) . node {
695695 ImplItemKind :: Method ( ref impl_m_sig, _) => {
696696 let pos = if impl_number_args > 0 {
697697 impl_number_args - 1
@@ -962,7 +962,7 @@ pub fn compare_const_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
962962 trait_ty) ;
963963
964964 // Locate the Span containing just the type of the offending impl
965- match tcx. hir ( ) . expect_impl_item_by_hir_id ( impl_c_hir_id) . node {
965+ match tcx. hir ( ) . expect_impl_item ( impl_c_hir_id) . node {
966966 ImplItemKind :: Const ( ref ty, _) => cause. span = ty. span ,
967967 _ => bug ! ( "{:?} is not a impl const" , impl_c) ,
968968 }
@@ -977,7 +977,7 @@ pub fn compare_const_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
977977 let trait_c_hir_id = tcx. hir ( ) . as_local_hir_id ( trait_c. def_id ) ;
978978 let trait_c_span = trait_c_hir_id. map ( |trait_c_hir_id| {
979979 // Add a label to the Span containing just the type of the const
980- match tcx. hir ( ) . expect_trait_item_by_hir_id ( trait_c_hir_id) . node {
980+ match tcx. hir ( ) . expect_trait_item ( trait_c_hir_id) . node {
981981 TraitItemKind :: Const ( ref ty, _) => ty. span ,
982982 _ => bug ! ( "{:?} is not a trait const" , trait_c) ,
983983 }
0 commit comments