@@ -1208,7 +1208,7 @@ fn extract_spans_for_error_reporting<'tcx>(
12081208 TypeError :: ArgumentMutability ( i) | TypeError :: ArgumentSorts ( ExpectedFound { .. } , i) => {
12091209 ( impl_args. nth ( i) . unwrap ( ) , trait_args. and_then ( |mut args| args. nth ( i) ) )
12101210 }
1211- _ => ( cause. span , tcx. hir ( ) . span_if_local ( trait_m. def_id ) ) ,
1211+ _ => ( cause. span , tcx. hir_span_if_local ( trait_m. def_id ) ) ,
12121212 }
12131213}
12141214
@@ -1261,7 +1261,7 @@ fn compare_self_type<'tcx>(
12611261 self_descr
12621262 ) ;
12631263 err. span_label ( impl_m_span, format ! ( "`{self_descr}` used in impl" ) ) ;
1264- if let Some ( span) = tcx. hir ( ) . span_if_local ( trait_m. def_id ) {
1264+ if let Some ( span) = tcx. hir_span_if_local ( trait_m. def_id ) {
12651265 err. span_label ( span, format ! ( "trait method declared without `{self_descr}`" ) ) ;
12661266 } else {
12671267 err. note_trait_signature ( trait_m. name , trait_m. signature ( tcx) ) ;
@@ -1281,7 +1281,7 @@ fn compare_self_type<'tcx>(
12811281 self_descr
12821282 ) ;
12831283 err. span_label ( impl_m_span, format ! ( "expected `{self_descr}` in impl" ) ) ;
1284- if let Some ( span) = tcx. hir ( ) . span_if_local ( trait_m. def_id ) {
1284+ if let Some ( span) = tcx. hir_span_if_local ( trait_m. def_id ) {
12851285 err. span_label ( span, format ! ( "`{self_descr}` used in trait" ) ) ;
12861286 } else {
12871287 err. note_trait_signature ( trait_m. name , trait_m. signature ( tcx) ) ;
@@ -1389,7 +1389,7 @@ fn compare_number_of_generics<'tcx>(
13891389 . collect ( ) ;
13901390 ( Some ( arg_spans) , impl_trait_spans)
13911391 } else {
1392- let trait_span = tcx. hir ( ) . span_if_local ( trait_. def_id ) ;
1392+ let trait_span = tcx. hir_span_if_local ( trait_. def_id ) ;
13931393 ( trait_span. map ( |s| vec ! [ s] ) , vec ! [ ] )
13941394 } ;
13951395
@@ -1481,7 +1481,7 @@ fn compare_number_of_method_arguments<'tcx>(
14811481 }
14821482 } )
14831483 } )
1484- . or_else ( || tcx. hir ( ) . span_if_local ( trait_m. def_id ) ) ;
1484+ . or_else ( || tcx. hir_span_if_local ( trait_m. def_id ) ) ;
14851485
14861486 let ( impl_m_sig, _) = & tcx. hir_expect_impl_item ( impl_m. def_id . expect_local ( ) ) . expect_fn ( ) ;
14871487 let pos = impl_number_args. saturating_sub ( 1 ) ;
@@ -2366,7 +2366,7 @@ fn try_report_async_mismatch<'tcx>(
23662366 return Err ( tcx. sess . dcx ( ) . emit_err ( MethodShouldReturnFuture {
23672367 span : tcx. def_span ( impl_m. def_id ) ,
23682368 method_name : tcx. item_ident ( impl_m. def_id ) ,
2369- trait_item_span : tcx. hir ( ) . span_if_local ( trait_m. def_id ) ,
2369+ trait_item_span : tcx. hir_span_if_local ( trait_m. def_id ) ,
23702370 } ) ) ;
23712371 }
23722372 }
0 commit comments