@@ -237,7 +237,7 @@ pub(crate) fn type_check<'mir, 'tcx>(
237237 decl. hidden_type . span ,
238238 format ! ( "could not resolve {:#?}" , hidden_type. ty. kind( ) ) ,
239239 ) ;
240- hidden_type. ty = infcx. tcx . ty_error ( reported) ;
240+ hidden_type. ty = Ty :: new_error ( infcx. tcx , reported) ;
241241 }
242242
243243 ( opaque_type_key, hidden_type)
@@ -520,7 +520,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
520520 for elem in place. projection . iter ( ) {
521521 if place_ty. variant_index . is_none ( ) {
522522 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) ) ;
524524 }
525525 }
526526 place_ty = self . sanitize_projection ( place_ty, elem, place, location, context) ;
@@ -656,7 +656,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
656656 PlaceTy :: from_ty ( match base_ty. kind ( ) {
657657 ty:: Array ( inner, _) => {
658658 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)
660660 }
661661 ty:: Slice ( ..) => {
662662 assert ! ( from_end, "slice subslices should use from_end" ) ;
@@ -749,7 +749,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
749749 }
750750
751751 fn error ( & mut self ) -> Ty < ' tcx > {
752- self . tcx ( ) . ty_error_misc ( )
752+ Ty :: new_misc_error ( self . tcx ( ) )
753753 }
754754
755755 fn get_ambient_variance ( & self , context : PlaceContext ) -> ty:: Variance {
@@ -1918,7 +1918,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19181918 // and hence may contain unnormalized results.
19191919 let fn_sig = self . normalize ( fn_sig, location) ;
19201920
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) ;
19221922
19231923 if let Err ( terr) = self . eq_types (
19241924 * ty,
@@ -1942,7 +1942,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19421942 ty:: Closure ( _, substs) => substs. as_closure ( ) . sig ( ) ,
19431943 _ => bug ! ( ) ,
19441944 } ;
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) ) ;
19461947
19471948 if let Err ( terr) = self . eq_types (
19481949 * ty,
0 commit comments