@@ -78,7 +78,7 @@ impl InferenceDiagnosticsData {
78
78
}
79
79
80
80
fn where_x_is_kind ( & self , in_type : Ty < ' _ > ) -> & ' static str {
81
- if in_type. is_ty_infer ( ) {
81
+ if in_type. is_ty_or_numeric_infer ( ) {
82
82
""
83
83
} else if self . name == "_" {
84
84
// FIXME: Consider specializing this message if there is a single `_`
@@ -195,12 +195,12 @@ fn ty_to_string<'tcx>(
195
195
// invalid pseudo-syntax, we want the `fn`-pointer output instead.
196
196
( ty:: FnDef ( ..) , _) => ty. fn_sig ( infcx. tcx ) . print ( printer) . unwrap ( ) . into_buffer ( ) ,
197
197
( _, Some ( def_id) )
198
- if ty. is_ty_infer ( )
198
+ if ty. is_ty_or_numeric_infer ( )
199
199
&& infcx. tcx . get_diagnostic_item ( sym:: iterator_collect_fn) == Some ( def_id) =>
200
200
{
201
201
"Vec<_>" . to_string ( )
202
202
}
203
- _ if ty. is_ty_infer ( ) => "/* Type */" . to_string ( ) ,
203
+ _ if ty. is_ty_or_numeric_infer ( ) => "/* Type */" . to_string ( ) ,
204
204
// FIXME: The same thing for closures, but this only works when the closure
205
205
// does not capture anything.
206
206
//
@@ -680,7 +680,7 @@ impl<'tcx> InferSourceKind<'tcx> {
680
680
| InferSourceKind :: ClosureReturn { ty, .. } => {
681
681
if ty. is_closure ( ) {
682
682
( "closure" , closure_as_fn_str ( infcx, ty) )
683
- } else if !ty. is_ty_infer ( ) {
683
+ } else if !ty. is_ty_or_numeric_infer ( ) {
684
684
( "normal" , ty_to_string ( infcx, ty, None ) )
685
685
} else {
686
686
( "other" , String :: new ( ) )
@@ -813,7 +813,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
813
813
self . attempt += 1 ;
814
814
if let Some ( InferSource { kind : InferSourceKind :: GenericArg { def_id : did, ..} , .. } ) = self . infer_source
815
815
&& let InferSourceKind :: LetBinding { ref ty, ref mut def_id, ..} = new_source. kind
816
- && ty. is_ty_infer ( )
816
+ && ty. is_ty_or_numeric_infer ( )
817
817
{
818
818
// Customize the output so we talk about `let x: Vec<_> = iter.collect();` instead of
819
819
// `let x: _ = iter.collect();`, as this is a very common case.
0 commit comments