@@ -429,7 +429,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
429
429
}
430
430
if let ( hir:: TyKind :: Infer , false ) = ( & ty. kind , self . astconv . allow_ty_infer ( ) ) {
431
431
self . inferred_params . push ( ty. span ) ;
432
- tcx. ty_error ( ) . into ( )
432
+ tcx. ty_error_misc ( ) . into ( )
433
433
} else {
434
434
self . astconv . ast_ty_to_ty ( ty) . into ( )
435
435
}
@@ -502,14 +502,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
502
502
_ => false ,
503
503
} ) {
504
504
// Avoid ICE #86756 when type error recovery goes awry.
505
- return tcx. ty_error ( ) . into ( ) ;
505
+ return tcx. ty_error_misc ( ) . into ( ) ;
506
506
}
507
507
tcx. at ( self . span ) . type_of ( param. def_id ) . subst ( tcx, substs) . into ( )
508
508
} else if infer_args {
509
509
self . astconv . ty_infer ( Some ( param) , self . span ) . into ( )
510
510
} else {
511
511
// We've already errored above about the mismatch.
512
- tcx. ty_error ( ) . into ( )
512
+ tcx. ty_error_misc ( ) . into ( )
513
513
}
514
514
}
515
515
GenericParamDefKind :: Const { has_default } => {
@@ -1239,9 +1239,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1239
1239
}
1240
1240
let reported = err. emit ( ) ;
1241
1241
term = match def_kind {
1242
- hir:: def:: DefKind :: AssocTy => {
1243
- tcx. ty_error_with_guaranteed ( reported) . into ( )
1244
- }
1242
+ hir:: def:: DefKind :: AssocTy => tcx. ty_error ( reported) . into ( ) ,
1245
1243
hir:: def:: DefKind :: AssocConst => tcx
1246
1244
. const_error_with_guaranteed (
1247
1245
tcx. type_of ( assoc_item_def_id)
@@ -1397,7 +1395,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1397
1395
. map ( |trait_ref| tcx. def_span ( trait_ref) ) ;
1398
1396
let reported =
1399
1397
tcx. sess . emit_err ( TraitObjectDeclaredWithNoTraits { span, trait_alias_span } ) ;
1400
- return tcx. ty_error_with_guaranteed ( reported) ;
1398
+ return tcx. ty_error ( reported) ;
1401
1399
}
1402
1400
1403
1401
// Check that there are no gross object safety violations;
@@ -1414,7 +1412,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1414
1412
& object_safety_violations,
1415
1413
)
1416
1414
. emit ( ) ;
1417
- return tcx. ty_error_with_guaranteed ( reported) ;
1415
+ return tcx. ty_error ( reported) ;
1418
1416
}
1419
1417
}
1420
1418
@@ -1523,10 +1521,10 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1523
1521
if arg == dummy_self. into ( ) {
1524
1522
let param = & generics. params [ index] ;
1525
1523
missing_type_params. push ( param. name ) ;
1526
- return tcx. ty_error ( ) . into ( ) ;
1524
+ return tcx. ty_error_misc ( ) . into ( ) ;
1527
1525
} else if arg. walk ( ) . any ( |arg| arg == dummy_self. into ( ) ) {
1528
1526
references_self = true ;
1529
- return tcx. ty_error ( ) . into ( ) ;
1527
+ return tcx. ty_error_misc ( ) . into ( ) ;
1530
1528
}
1531
1529
arg
1532
1530
} )
@@ -1588,7 +1586,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1588
1586
. iter ( )
1589
1587
. map ( |arg| {
1590
1588
if arg. walk ( ) . any ( |arg| arg == dummy_self. into ( ) ) {
1591
- return tcx. ty_error_with_guaranteed ( guar) . into ( ) ;
1589
+ return tcx. ty_error ( guar) . into ( ) ;
1592
1590
}
1593
1591
arg
1594
1592
} )
@@ -2474,7 +2472,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2474
2472
& [ path_str] ,
2475
2473
item_segment. ident . name ,
2476
2474
) ;
2477
- return tcx. ty_error_with_guaranteed ( reported)
2475
+ return tcx. ty_error ( reported)
2478
2476
} ;
2479
2477
2480
2478
debug ! ( "qpath_to_ty: self_type={:?}" , self_ty) ;
@@ -2821,7 +2819,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2821
2819
let index = generics. param_def_id_to_index [ & def_id. to_def_id ( ) ] ;
2822
2820
tcx. mk_ty_param ( index, tcx. hir ( ) . ty_param_name ( def_id) )
2823
2821
}
2824
- Some ( rbv:: ResolvedArg :: Error ( guar) ) => tcx. ty_error_with_guaranteed ( guar) ,
2822
+ Some ( rbv:: ResolvedArg :: Error ( guar) ) => tcx. ty_error ( guar) ,
2825
2823
arg => bug ! ( "unexpected bound var resolution for {hir_id:?}: {arg:?}" ) ,
2826
2824
}
2827
2825
}
@@ -2933,7 +2931,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2933
2931
{
2934
2932
err. span_note ( impl_. self_ty . span , "not a concrete type" ) ;
2935
2933
}
2936
- tcx. ty_error_with_guaranteed ( err. emit ( ) )
2934
+ tcx. ty_error ( err. emit ( ) )
2937
2935
} else {
2938
2936
ty
2939
2937
}
@@ -2986,7 +2984,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2986
2984
. sess
2987
2985
. delay_span_bug ( path. span , "path with `Res::Err` but no error emitted" ) ;
2988
2986
self . set_tainted_by_errors ( e) ;
2989
- self . tcx ( ) . ty_error_with_guaranteed ( e)
2987
+ self . tcx ( ) . ty_error ( e)
2990
2988
}
2991
2989
_ => span_bug ! ( span, "unexpected resolution: {:?}" , path. res) ,
2992
2990
}
@@ -3065,7 +3063,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
3065
3063
let ty = self . ast_ty_to_ty_inner ( qself, false , true ) ;
3066
3064
self . associated_path_to_ty ( ast_ty. hir_id , ast_ty. span , ty, qself, segment, false )
3067
3065
. map ( |( ty, _, _) | ty)
3068
- . unwrap_or_else ( |guar| tcx. ty_error_with_guaranteed ( guar) )
3066
+ . unwrap_or_else ( |guar| tcx. ty_error ( guar) )
3069
3067
}
3070
3068
& hir:: TyKind :: Path ( hir:: QPath :: LangItem ( lang_item, span, _) ) => {
3071
3069
let def_id = tcx. require_lang_item ( lang_item, Some ( span) ) ;
@@ -3113,7 +3111,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
3113
3111
// handled specially and will not descend into this routine.
3114
3112
self . ty_infer ( None , ast_ty. span )
3115
3113
}
3116
- hir:: TyKind :: Err => tcx. ty_error ( ) ,
3114
+ hir:: TyKind :: Err => tcx. ty_error_misc ( ) ,
3117
3115
} ;
3118
3116
3119
3117
self . record_ty ( ast_ty. hir_id , result_ty, ast_ty. span ) ;
0 commit comments