@@ -289,7 +289,7 @@ fn closure_as_fn_str<'tcx>(infcx: &InferCtxt<'tcx>, ty: Ty<'tcx>) -> String {
289289 format ! ( "fn({args}){ret}" )
290290}
291291
292- impl < ' tcx > InferCtxt < ' tcx > {
292+ impl < ' a , ' tcx > TypeErrCtxt < ' a , ' tcx > {
293293 /// Extracts data used by diagnostic for either types or constants
294294 /// which were stuck during inference.
295295 pub fn extract_inference_diagnostics_data (
@@ -391,7 +391,7 @@ impl<'tcx> InferCtxt<'tcx> {
391391 span : Span ,
392392 arg_data : InferenceDiagnosticsData ,
393393 error_code : TypeAnnotationNeeded ,
394- ) -> Diag < ' _ > {
394+ ) -> Diag < ' a > {
395395 let source_kind = "other" ;
396396 let source_name = "" ;
397397 let failure_span = None ;
@@ -434,9 +434,7 @@ impl<'tcx> InferCtxt<'tcx> {
434434 } ) ,
435435 }
436436 }
437- }
438437
439- impl < ' a , ' tcx > TypeErrCtxt < ' a , ' tcx > {
440438 #[ instrument( level = "debug" , skip( self , error_code) ) ]
441439 pub fn emit_inference_failure_err (
442440 & self ,
@@ -453,7 +451,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
453451 // If we don't have any typeck results we're outside
454452 // of a body, so we won't be able to get better info
455453 // 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) ;
457455 } ;
458456
459457 let mut local_visitor = FindInferSourceVisitor :: new ( self , typeck_results, arg) ;
@@ -465,7 +463,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
465463 }
466464
467465 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) ;
469467 } ;
470468
471469 let ( source_kind, name, path) = kind. ty_localized_msg ( self ) ;
0 commit comments