@@ -480,7 +480,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
480480 let projected_ty = curr_projected_ty. projection_ty_core (
481481 tcx,
482482 proj,
483- |ty| self . normalize ( ty, locations) ,
483+ |ty| self . normalize ( ty:: Unnormalized :: new_wip ( ty ) , locations) ,
484484 |ty, variant_index, field, ( ) | PlaceTy :: field_ty ( tcx, ty, variant_index, field) ,
485485 |_| unreachable ! ( ) ,
486486 ) ;
@@ -490,8 +490,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
490490
491491 // Need to renormalize `a` as typecheck may have failed to normalize
492492 // higher-ranked aliases if normalization was ambiguous due to inference.
493- let a = self . normalize ( a , locations) ;
494- let ty = self . normalize ( curr_projected_ty. ty , locations) ;
493+ let a = self . normalize ( ty :: Unnormalized :: new_wip ( a ) , locations) ;
494+ let ty = self . normalize ( ty :: Unnormalized :: new_wip ( curr_projected_ty. ty ) , locations) ;
495495 self . relate_types ( ty, v. xform ( ty:: Contravariant ) , a, locations, category) ?;
496496
497497 Ok ( ( ) )
@@ -639,11 +639,11 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
639639
640640 let place_ty = place. ty ( self . body , tcx) . ty ;
641641 debug ! ( ?place_ty) ;
642- let place_ty = self . normalize ( place_ty, location) ;
642+ let place_ty = self . normalize ( ty :: Unnormalized :: new_wip ( place_ty) , location) ;
643643 debug ! ( "place_ty normalized: {:?}" , place_ty) ;
644644 let rv_ty = rv. ty ( self . body , tcx) ;
645645 debug ! ( ?rv_ty) ;
646- let rv_ty = self . normalize ( rv_ty, location) ;
646+ let rv_ty = self . normalize ( ty :: Unnormalized :: new_wip ( rv_ty) , location) ;
647647 debug ! ( "normalized rv_ty: {:?}" , rv_ty) ;
648648 if let Err ( terr) =
649649 self . sub_types ( rv_ty, place_ty, location. to_locations ( ) , category)
@@ -1082,7 +1082,8 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
10821082 } ,
10831083 ) ;
10841084
1085- let src_ty = self . normalize ( src_ty, location) ;
1085+ let src_ty =
1086+ self . normalize ( ty:: Unnormalized :: new_wip ( src_ty) , location) ;
10861087 if let Err ( terr) = self . sub_types (
10871088 src_ty,
10881089 * ty,
@@ -1124,7 +1125,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
11241125 // function definition. When we extract the
11251126 // signature, it comes from the `fn_sig` query,
11261127 // and hence may contain unnormalized results.
1127- let src_ty = self . normalize ( src_ty, location) ;
1128+ let src_ty = self . normalize ( ty :: Unnormalized :: new_wip ( src_ty) , location) ;
11281129 if let Err ( terr) = self . sub_types (
11291130 src_ty,
11301131 * ty,
@@ -1190,7 +1191,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
11901191 // function definition. When we extract the
11911192 // signature, it comes from the `fn_sig` query,
11921193 // and hence may contain unnormalized results.
1193- let fn_sig = self . normalize ( fn_sig, location) ;
1194+ let fn_sig = self . normalize ( ty :: Unnormalized :: new_wip ( fn_sig) , location) ;
11941195
11951196 let ty_fn_ptr_from = tcx. safe_to_unsafe_fn_ty ( fn_sig) ;
11961197
@@ -1786,8 +1787,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
17861787 ) ;
17871788 }
17881789 } else if let Some ( static_def_id) = constant. check_static_ptr ( tcx) {
1789- let unnormalized_ty =
1790- tcx. type_of ( static_def_id) . instantiate_identity ( ) . skip_norm_wip ( ) ;
1790+ let unnormalized_ty = tcx. type_of ( static_def_id) . instantiate_identity ( ) ;
17911791 let normalized_ty = self . normalize ( unnormalized_ty, locations) ;
17921792 let literal_ty = constant. const_ . ty ( ) . builtin_deref ( true ) . unwrap ( ) ;
17931793
@@ -1876,9 +1876,9 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
18761876 | ProjectionElem :: Subslice { .. }
18771877 | ProjectionElem :: Downcast ( ..) => { }
18781878 ProjectionElem :: Field ( field, fty) => {
1879- let fty = self . normalize ( fty, location) ;
1879+ let fty = self . normalize ( ty :: Unnormalized :: new_wip ( fty) , location) ;
18801880 let ty = PlaceTy :: field_ty ( tcx, base_ty. ty , base_ty. variant_index , field) ;
1881- let ty = self . normalize ( ty, location) ;
1881+ let ty = self . normalize ( ty:: Unnormalized :: new_wip ( ty ) , location) ;
18821882 debug ! ( ?fty, ?ty) ;
18831883
18841884 if let Err ( terr) = self . relate_types (
@@ -1892,7 +1892,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
18921892 }
18931893 }
18941894 ProjectionElem :: OpaqueCast ( ty) => {
1895- let ty = self . normalize ( ty, location) ;
1895+ let ty = self . normalize ( ty:: Unnormalized :: new_wip ( ty ) , location) ;
18961896 self . relate_types (
18971897 ty,
18981898 context. ambient_variance ( ) ,
@@ -1945,7 +1945,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19451945 }
19461946 } else {
19471947 let dest_ty = destination. ty ( self . body , tcx) . ty ;
1948- let dest_ty = self . normalize ( dest_ty, term_location) ;
1948+ let dest_ty = self . normalize ( ty :: Unnormalized :: new_wip ( dest_ty) , term_location) ;
19491949 let category = match destination. as_local ( ) {
19501950 Some ( RETURN_PLACE ) => {
19511951 if let DefiningTy :: Const ( def_id, _) | DefiningTy :: InlineConst ( def_id, _) =
@@ -2030,7 +2030,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20302030 for ( n, ( fn_arg, op_arg) ) in iter:: zip ( sig. inputs ( ) , args) . enumerate ( ) {
20312031 let op_arg_ty = op_arg. node . ty ( self . body , self . tcx ( ) ) ;
20322032
2033- let op_arg_ty = self . normalize ( op_arg_ty, term_location) ;
2033+ let op_arg_ty = self . normalize ( ty :: Unnormalized :: new_wip ( op_arg_ty) , term_location) ;
20342034 let category = if call_source. from_hir_call ( ) {
20352035 ConstraintCategory :: CallArgument ( Some (
20362036 self . infcx . tcx . erase_and_anonymize_regions ( func_ty) ,
@@ -2198,7 +2198,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21982198 let variant = & def. variant ( variant_index) ;
21992199 let adj_field_index = active_field_index. unwrap_or ( field_index) ;
22002200 if let Some ( field) = variant. fields . get ( adj_field_index) {
2201- Ok ( self . normalize ( field. ty ( tcx, args) , location) )
2201+ Ok ( self . normalize ( ty :: Unnormalized :: new_wip ( field. ty ( tcx, args) ) , location) )
22022202 } else {
22032203 Err ( FieldAccessError :: OutOfRange { field_count : variant. fields . len ( ) } )
22042204 }
@@ -2302,7 +2302,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
23022302 }
23032303 } ;
23042304 let operand_ty = operand. ty ( self . body , tcx) ;
2305- let operand_ty = self . normalize ( operand_ty, location) ;
2305+ let operand_ty = self . normalize ( ty :: Unnormalized :: new_wip ( operand_ty) , location) ;
23062306
23072307 if let Err ( terr) = self . sub_types (
23082308 operand_ty,
0 commit comments