@@ -237,7 +237,7 @@ pub(crate) fn type_check<'mir, 'tcx>(
237
237
decl. hidden_type . span ,
238
238
format ! ( "could not resolve {:#?}" , hidden_type. ty. kind( ) ) ,
239
239
) ;
240
- hidden_type. ty = infcx. tcx . ty_error ( reported) ;
240
+ hidden_type. ty = Ty :: new_error ( infcx. tcx , reported) ;
241
241
}
242
242
243
243
( opaque_type_key, hidden_type)
@@ -520,7 +520,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
520
520
for elem in place. projection . iter ( ) {
521
521
if place_ty. variant_index . is_none ( ) {
522
522
if let Err ( guar) = place_ty. ty . error_reported ( ) {
523
- return PlaceTy :: from_ty ( self . tcx ( ) . ty_error ( guar) ) ;
523
+ return PlaceTy :: from_ty ( Ty :: new_error ( self . tcx ( ) , guar) ) ;
524
524
}
525
525
}
526
526
place_ty = self . sanitize_projection ( place_ty, elem, place, location, context) ;
@@ -656,7 +656,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
656
656
PlaceTy :: from_ty ( match base_ty. kind ( ) {
657
657
ty:: Array ( inner, _) => {
658
658
assert ! ( !from_end, "array subslices should not use from_end" ) ;
659
- tcx . mk_array ( * inner, to - from)
659
+ Ty :: new_array ( tcx , * inner, to - from)
660
660
}
661
661
ty:: Slice ( ..) => {
662
662
assert ! ( from_end, "slice subslices should use from_end" ) ;
@@ -749,7 +749,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
749
749
}
750
750
751
751
fn error ( & mut self ) -> Ty < ' tcx > {
752
- self . tcx ( ) . ty_error_misc ( )
752
+ Ty :: new_misc_error ( self . tcx ( ) )
753
753
}
754
754
755
755
fn get_ambient_variance ( & self , context : PlaceContext ) -> ty:: Variance {
@@ -1918,7 +1918,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1918
1918
// and hence may contain unnormalized results.
1919
1919
let fn_sig = self . normalize ( fn_sig, location) ;
1920
1920
1921
- let ty_fn_ptr_from = tcx . mk_fn_ptr ( fn_sig) ;
1921
+ let ty_fn_ptr_from = Ty :: new_fn_ptr ( tcx , fn_sig) ;
1922
1922
1923
1923
if let Err ( terr) = self . eq_types (
1924
1924
* ty,
@@ -1942,7 +1942,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1942
1942
ty:: Closure ( _, substs) => substs. as_closure ( ) . sig ( ) ,
1943
1943
_ => bug ! ( ) ,
1944
1944
} ;
1945
- let ty_fn_ptr_from = tcx. mk_fn_ptr ( tcx. signature_unclosure ( sig, * unsafety) ) ;
1945
+ let ty_fn_ptr_from =
1946
+ Ty :: new_fn_ptr ( tcx, tcx. signature_unclosure ( sig, * unsafety) ) ;
1946
1947
1947
1948
if let Err ( terr) = self . eq_types (
1948
1949
* ty,
0 commit comments