@@ -195,7 +195,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
195
195
let ty_string = self . ty_to_string ( actual) ;
196
196
let is_method = mode == Mode :: MethodCall ;
197
197
let mut suggestion = None ;
198
- let type_str = if is_method {
198
+ let item_kind = if is_method {
199
199
"method"
200
200
} else if actual. is_enum ( ) {
201
201
if let TyAdt ( ref adt_def, _) = actual. sty {
@@ -235,7 +235,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
235
235
span,
236
236
E0689 ,
237
237
"can't call {} `{}` on ambiguous numeric type `{}`" ,
238
- type_str ,
238
+ item_kind ,
239
239
item_name,
240
240
ty_string
241
241
) ;
@@ -284,12 +284,12 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
284
284
span,
285
285
E0599 ,
286
286
"no {} named `{}` found for type `{}` in the current scope" ,
287
- type_str ,
287
+ item_kind ,
288
288
item_name,
289
289
ty_string
290
290
) ;
291
291
if let Some ( suggestion) = suggestion {
292
- err. note ( & format ! ( "did you mean `{}::{}`?" , type_str , suggestion) ) ;
292
+ err. note ( & format ! ( "did you mean `{}::{}`?" , ty_string , suggestion) ) ;
293
293
}
294
294
err
295
295
}
@@ -301,7 +301,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
301
301
if let Some ( full_sp) = tcx. hir . span_if_local ( def. did ) {
302
302
let def_sp = tcx. sess . codemap ( ) . def_span ( full_sp) ;
303
303
err. span_label ( def_sp, format ! ( "{} `{}` not found {}" ,
304
- type_str ,
304
+ item_kind ,
305
305
item_name,
306
306
if def. is_enum( ) && !is_method {
307
307
"here"
@@ -355,7 +355,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
355
355
}
356
356
}
357
357
} else {
358
- err. span_label ( span, format ! ( "{} not found in `{}`" , type_str , ty_string) ) ;
358
+ err. span_label ( span, format ! ( "{} not found in `{}`" , item_kind , ty_string) ) ;
359
359
}
360
360
361
361
if self . is_fn_ty ( & rcvr_ty, span) {
0 commit comments