@@ -417,7 +417,7 @@ fn extract_spans_for_error_reporting<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a
417
417
let tcx = infcx. tcx ;
418
418
let impl_m_hir_id = tcx. hir ( ) . as_local_hir_id ( impl_m. def_id ) . unwrap ( ) ;
419
419
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)
421
421
. node {
422
422
ImplItemKind :: Method ( ref impl_m_sig, _) => {
423
423
( & 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
429
429
TypeError :: Mutability => {
430
430
if let Some ( trait_m_hir_id) = tcx. hir ( ) . as_local_hir_id ( trait_m. def_id ) {
431
431
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)
433
433
. node {
434
434
TraitItemKind :: Method ( ref trait_m_sig, _) => {
435
435
trait_m_sig. decl . inputs . iter ( )
@@ -456,7 +456,7 @@ fn extract_spans_for_error_reporting<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a
456
456
TypeError :: Sorts ( ExpectedFound { .. } ) => {
457
457
if let Some ( trait_m_hir_id) = tcx. hir ( ) . as_local_hir_id ( trait_m. def_id ) {
458
458
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 {
460
460
TraitItemKind :: Method ( ref trait_m_sig, _) => {
461
461
( & trait_m_sig. decl . output , trait_m_sig. decl . inputs . iter ( ) )
462
462
}
@@ -599,8 +599,8 @@ fn compare_number_of_generics<'a, 'tcx>(
599
599
if impl_count != trait_count {
600
600
err_occurred = true ;
601
601
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 ) ;
604
604
let span = if impl_item. generics . params . is_empty ( )
605
605
|| impl_item. generics . span . is_dummy ( ) { // argument position impl Trait (#55374)
606
606
impl_span
@@ -666,7 +666,7 @@ fn compare_number_of_method_arguments<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
666
666
if trait_number_args != impl_number_args {
667
667
let trait_m_hir_id = tcx. hir ( ) . as_local_hir_id ( trait_m. def_id ) ;
668
668
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 {
670
670
TraitItemKind :: Method ( ref trait_m_sig, _) => {
671
671
let pos = if trait_number_args > 0 {
672
672
trait_number_args - 1
@@ -691,7 +691,7 @@ fn compare_number_of_method_arguments<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
691
691
trait_item_span
692
692
} ;
693
693
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 {
695
695
ImplItemKind :: Method ( ref impl_m_sig, _) => {
696
696
let pos = if impl_number_args > 0 {
697
697
impl_number_args - 1
@@ -962,7 +962,7 @@ pub fn compare_const_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
962
962
trait_ty) ;
963
963
964
964
// 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 {
966
966
ImplItemKind :: Const ( ref ty, _) => cause. span = ty. span ,
967
967
_ => bug ! ( "{:?} is not a impl const" , impl_c) ,
968
968
}
@@ -977,7 +977,7 @@ pub fn compare_const_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
977
977
let trait_c_hir_id = tcx. hir ( ) . as_local_hir_id ( trait_c. def_id ) ;
978
978
let trait_c_span = trait_c_hir_id. map ( |trait_c_hir_id| {
979
979
// 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 {
981
981
TraitItemKind :: Const ( ref ty, _) => ty. span ,
982
982
_ => bug ! ( "{:?} is not a trait const" , trait_c) ,
983
983
}
0 commit comments