@@ -289,7 +289,7 @@ fn closure_as_fn_str<'tcx>(infcx: &InferCtxt<'tcx>, ty: Ty<'tcx>) -> String {
289
289
format ! ( "fn({args}){ret}" )
290
290
}
291
291
292
- impl < ' tcx > InferCtxt < ' tcx > {
292
+ impl < ' a , ' tcx > TypeErrCtxt < ' a , ' tcx > {
293
293
/// Extracts data used by diagnostic for either types or constants
294
294
/// which were stuck during inference.
295
295
pub fn extract_inference_diagnostics_data (
@@ -391,7 +391,7 @@ impl<'tcx> InferCtxt<'tcx> {
391
391
span : Span ,
392
392
arg_data : InferenceDiagnosticsData ,
393
393
error_code : TypeAnnotationNeeded ,
394
- ) -> Diag < ' _ > {
394
+ ) -> Diag < ' a > {
395
395
let source_kind = "other" ;
396
396
let source_name = "" ;
397
397
let failure_span = None ;
@@ -434,9 +434,7 @@ impl<'tcx> InferCtxt<'tcx> {
434
434
} ) ,
435
435
}
436
436
}
437
- }
438
437
439
- impl < ' a , ' tcx > TypeErrCtxt < ' a , ' tcx > {
440
438
#[ instrument( level = "debug" , skip( self , error_code) ) ]
441
439
pub fn emit_inference_failure_err (
442
440
& self ,
@@ -453,7 +451,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
453
451
// If we don't have any typeck results we're outside
454
452
// of a body, so we won't be able to get better info
455
453
// here.
456
- return self . infcx . bad_inference_failure_err ( failure_span, arg_data, error_code) ;
454
+ return self . bad_inference_failure_err ( failure_span, arg_data, error_code) ;
457
455
} ;
458
456
459
457
let mut local_visitor = FindInferSourceVisitor :: new ( self , typeck_results, arg) ;
@@ -465,7 +463,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
465
463
}
466
464
467
465
let Some ( InferSource { span, kind } ) = local_visitor. infer_source else {
468
- return self . infcx . bad_inference_failure_err ( failure_span, arg_data, error_code) ;
466
+ return self . bad_inference_failure_err ( failure_span, arg_data, error_code) ;
469
467
} ;
470
468
471
469
let ( source_kind, name, path) = kind. ty_localized_msg ( self ) ;
0 commit comments