@@ -17,7 +17,7 @@ use rustc_middle::ty::fold::BottomUpFolder;
1717use rustc_middle:: ty:: util:: ExplicitSelf ;
1818use rustc_middle:: ty:: {
1919 self , GenericArgs , GenericParamDefKind , Ty , TyCtxt , TypeFoldable , TypeFolder ,
20- TypeSuperFoldable , TypeVisitableExt , Upcast ,
20+ TypeSuperFoldable , TypeVisitableExt , TypingMode , Upcast ,
2121} ;
2222use rustc_middle:: { bug, span_bug} ;
2323use rustc_span:: Span ;
@@ -209,7 +209,7 @@ fn compare_method_predicate_entailment<'tcx>(
209209 let param_env = traits:: normalize_param_env_or_error ( tcx, param_env, normalize_cause) ;
210210 debug ! ( caller_bounds=?param_env. caller_bounds( ) ) ;
211211
212- let infcx = & tcx. infer_ctxt ( ) . build ( ) ;
212+ let infcx = & tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
213213 let ocx = ObligationCtxt :: new_with_diagnostics ( infcx) ;
214214
215215 // Create obligations for each predicate declared by the impl
@@ -469,7 +469,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
469469 ObligationCause :: misc ( tcx. def_span ( impl_m_def_id) , impl_m_def_id) ,
470470 ) ;
471471
472- let infcx = & tcx. infer_ctxt ( ) . build ( ) ;
472+ let infcx = & tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
473473 let ocx = ObligationCtxt :: new_with_diagnostics ( infcx) ;
474474
475475 // Normalize the impl signature with fresh variables for lifetime inference.
@@ -1149,7 +1149,7 @@ fn compare_self_type<'tcx>(
11491149 let self_arg_ty = tcx. fn_sig ( method. def_id ) . instantiate_identity ( ) . input ( 0 ) ;
11501150 let param_env = ty:: ParamEnv :: reveal_all ( ) ;
11511151
1152- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1152+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
11531153 let self_arg_ty = tcx. liberate_late_bound_regions ( method. def_id , self_arg_ty) ;
11541154 let can_eq_self = |ty| infcx. can_eq ( param_env, untransformed_self_ty, ty) ;
11551155 match ExplicitSelf :: determine ( self_arg_ty, can_eq_self) {
@@ -1754,7 +1754,7 @@ fn compare_const_predicate_entailment<'tcx>(
17541754 ObligationCause :: misc ( impl_ct_span, impl_ct_def_id) ,
17551755 ) ;
17561756
1757- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1757+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
17581758 let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
17591759
17601760 let impl_ct_own_bounds = impl_ct_predicates. instantiate_own_identity ( ) ;
@@ -1885,7 +1885,7 @@ fn compare_type_predicate_entailment<'tcx>(
18851885 let param_env = traits:: normalize_param_env_or_error ( tcx, param_env, normalize_cause) ;
18861886 debug ! ( caller_bounds=?param_env. caller_bounds( ) ) ;
18871887
1888- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1888+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
18891889 let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
18901890
18911891 for ( predicate, span) in impl_ty_own_bounds {
@@ -1947,7 +1947,7 @@ pub(super) fn check_type_bounds<'tcx>(
19471947 let impl_ty_args = GenericArgs :: identity_for_item ( tcx, impl_ty. def_id ) ;
19481948 let rebased_args = impl_ty_args. rebase_onto ( tcx, container_id, impl_trait_ref. args ) ;
19491949
1950- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1950+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
19511951 let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
19521952
19531953 // A synthetic impl Trait for RPITIT desugaring or assoc type for effects desugaring has no HIR,
0 commit comments