@@ -221,7 +221,7 @@ impl Into<rustc_errors::DiagnosticId> for TypeAnnotationNeeded {
221
221
}
222
222
223
223
/// Information about a constant or a type containing inference variables.
224
- pub struct InferDiagnosticsData {
224
+ pub struct InferenceDiagnosticsData {
225
225
pub name : String ,
226
226
pub span : Option < Span > ,
227
227
pub description : Cow < ' static , str > ,
@@ -232,11 +232,11 @@ pub struct InferDiagnosticsData {
232
232
impl < ' a , ' tcx > InferCtxt < ' a , ' tcx > {
233
233
/// Extracts data used by diagnostic for either types or constants
234
234
/// which were stuck during inference.
235
- pub fn extract_infer_data (
235
+ pub fn extract_inference_diagnostics_data (
236
236
& self ,
237
237
arg : GenericArg < ' tcx > ,
238
238
highlight : Option < ty:: print:: RegionHighlightMode > ,
239
- ) -> InferDiagnosticsData {
239
+ ) -> InferenceDiagnosticsData {
240
240
match arg. unpack ( ) {
241
241
GenericArgKind :: Type ( ty) => {
242
242
if let ty:: Infer ( ty:: TyVar ( ty_vid) ) = * ty. kind ( ) {
@@ -266,7 +266,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
266
266
} ;
267
267
268
268
if name != kw:: SelfUpper {
269
- return InferDiagnosticsData {
269
+ return InferenceDiagnosticsData {
270
270
name : name. to_string ( ) ,
271
271
span : Some ( var_origin. span ) ,
272
272
description : "type parameter" . into ( ) ,
@@ -283,7 +283,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
283
283
printer. region_highlight_mode = highlight;
284
284
}
285
285
let _ = ty. print ( printer) ;
286
- InferDiagnosticsData {
286
+ InferenceDiagnosticsData {
287
287
name : s,
288
288
span : None ,
289
289
description : ty. prefix_string ( ) ,
@@ -317,7 +317,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
317
317
( None , None )
318
318
} ;
319
319
320
- return InferDiagnosticsData {
320
+ return InferenceDiagnosticsData {
321
321
name : name. to_string ( ) ,
322
322
span : Some ( origin. span ) ,
323
323
description : "const parameter" . into ( ) ,
@@ -334,7 +334,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
334
334
printer. region_highlight_mode = highlight;
335
335
}
336
336
let _ = ct. print ( printer) ;
337
- InferDiagnosticsData {
337
+ InferenceDiagnosticsData {
338
338
name : s,
339
339
span : Some ( origin. span ) ,
340
340
description : "the constant" . into ( ) ,
@@ -349,16 +349,16 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
349
349
}
350
350
}
351
351
352
- pub fn need_type_info_err (
352
+ pub fn emit_inference_failure_err (
353
353
& self ,
354
354
body_id : Option < hir:: BodyId > ,
355
355
span : Span ,
356
356
arg : GenericArg < ' tcx > ,
357
357
error_code : TypeAnnotationNeeded ,
358
358
) -> DiagnosticBuilder < ' tcx > {
359
- let ty = self . resolve_vars_if_possible ( & arg) ;
360
- let arg_data = self . extract_infer_data ( arg, None ) ;
361
- let kind_str = match ty . unpack ( ) {
359
+ let arg = self . resolve_vars_if_possible ( & arg) ;
360
+ let arg_data = self . extract_inference_diagnostics_data ( arg, None ) ;
361
+ let kind_str = match arg . unpack ( ) {
362
362
GenericArgKind :: Type ( _) => "type" ,
363
363
GenericArgKind :: Const ( _) => "the value" ,
364
364
GenericArgKind :: Lifetime ( _) => bug ! ( "unexpected lifetime" ) ,
@@ -700,7 +700,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
700
700
ty : Ty < ' tcx > ,
701
701
) -> DiagnosticBuilder < ' tcx > {
702
702
let ty = self . resolve_vars_if_possible ( & ty) ;
703
- let data = self . extract_infer_data ( ty. into ( ) , None ) ;
703
+ let data = self . extract_inference_diagnostics_data ( ty. into ( ) , None ) ;
704
704
705
705
let mut err = struct_span_err ! (
706
706
self . tcx. sess,
0 commit comments