@@ -7,14 +7,13 @@ use rustc_hir::def_id::{DefId, LocalDefId};
7
7
use rustc_hir:: { self as hir, FnSig , HirId , ItemKind } ;
8
8
use rustc_infer:: infer:: { self , InferCtxt , TyCtxtInferExt } ;
9
9
use rustc_infer:: traits:: { ObligationCause , ObligationCauseCode } ;
10
- use rustc_middle:: ty;
10
+ use rustc_middle:: ty:: { self , TypingMode } ;
11
11
use rustc_middle:: ty:: TyCtxt ;
12
12
use rustc_middle:: ty:: error:: { ExpectedFound , TypeError } ;
13
13
use rustc_span:: { ErrorGuaranteed , Ident , Span , Symbol } ;
14
14
use rustc_trait_selection:: error_reporting:: InferCtxtErrorExt ;
15
15
use rustc_trait_selection:: regions:: InferCtxtRegionExt ;
16
16
use rustc_trait_selection:: traits:: ObligationCtxt ;
17
- use rustc_type_ir:: TypingMode ;
18
17
use tracing:: { debug, instrument} ;
19
18
20
19
use super :: potentially_plural_count;
@@ -147,7 +146,7 @@ fn compare_number_of_method_arguments<'tcx>(
147
146
} )
148
147
. or_else ( || tcx. hir ( ) . span_if_local ( declaration) ) ;
149
148
150
- let ( external_impl_sig, _, _) = & tcx. hir ( ) . expect_item ( external_impl) . expect_fn ( ) ;
149
+ let ( _ , external_impl_sig, _, _) = & tcx. hir_expect_item ( external_impl) . expect_fn ( ) ;
151
150
let pos = external_impl_number_args. saturating_sub ( 1 ) ;
152
151
let impl_span = external_impl_sig
153
152
. decl
@@ -321,7 +320,7 @@ fn report_eii_mismatch<'tcx>(
321
320
if declaration_sig. inputs ( ) . len ( ) == * i {
322
321
// Suggestion to change output type. We do not suggest in `async` functions
323
322
// to avoid complex logic or incorrect output.
324
- if let ItemKind :: Fn { sig, .. } = & tcx. hir ( ) . expect_item ( external_impl_did) . kind
323
+ if let ItemKind :: Fn { sig, .. } = & tcx. hir_expect_item ( external_impl_did) . kind
325
324
&& !sig. header . asyncness . is_async ( )
326
325
{
327
326
let msg = "change the output type to match the declaration" ;
@@ -376,11 +375,11 @@ fn extract_spans_for_error_reporting<'tcx>(
376
375
) -> ( Span , Option < Span > , Ident ) {
377
376
let tcx = infcx. tcx ;
378
377
let ( mut external_impl_args, external_impl_name) = {
379
- let item = tcx. hir ( ) . expect_item ( external_impl) ;
380
- let ( sig, _, _) = item. expect_fn ( ) ;
378
+ let item = tcx. hir_expect_item ( external_impl) ;
379
+ let ( ident , sig, _, _) = item. expect_fn ( ) ;
381
380
(
382
381
sig. decl . inputs . iter ( ) . map ( |t| t. span ) . chain ( iter:: once ( sig. decl . output . span ( ) ) ) ,
383
- item . ident ,
382
+ ident,
384
383
)
385
384
} ;
386
385
0 commit comments