@@ -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 ;
@@ -228,7 +228,7 @@ fn compare_method_predicate_entailment<'tcx>(
228228 let param_env = traits:: normalize_param_env_or_error ( tcx, param_env, normalize_cause) ;
229229 debug ! ( caller_bounds=?param_env. caller_bounds( ) ) ;
230230
231- let infcx = & tcx. infer_ctxt ( ) . build ( ) ;
231+ let infcx = & tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
232232 let ocx = ObligationCtxt :: new_with_diagnostics ( infcx) ;
233233
234234 // Create obligations for each predicate declared by the impl
@@ -516,7 +516,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
516516 ObligationCause :: misc ( tcx. def_span ( impl_m_def_id) , impl_m_def_id) ,
517517 ) ;
518518
519- let infcx = & tcx. infer_ctxt ( ) . build ( ) ;
519+ let infcx = & tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
520520 let ocx = ObligationCtxt :: new_with_diagnostics ( infcx) ;
521521
522522 // Normalize the impl signature with fresh variables for lifetime inference.
@@ -1196,7 +1196,7 @@ fn compare_self_type<'tcx>(
11961196 let self_arg_ty = tcx. fn_sig ( method. def_id ) . instantiate_identity ( ) . input ( 0 ) ;
11971197 let param_env = ty:: ParamEnv :: reveal_all ( ) ;
11981198
1199- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1199+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
12001200 let self_arg_ty = tcx. liberate_late_bound_regions ( method. def_id , self_arg_ty) ;
12011201 let can_eq_self = |ty| infcx. can_eq ( param_env, untransformed_self_ty, ty) ;
12021202 match ExplicitSelf :: determine ( self_arg_ty, can_eq_self) {
@@ -1801,7 +1801,7 @@ fn compare_const_predicate_entailment<'tcx>(
18011801 ObligationCause :: misc ( impl_ct_span, impl_ct_def_id) ,
18021802 ) ;
18031803
1804- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1804+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
18051805 let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
18061806
18071807 let impl_ct_own_bounds = impl_ct_predicates. instantiate_own_identity ( ) ;
@@ -1951,7 +1951,7 @@ fn compare_type_predicate_entailment<'tcx>(
19511951 let param_env = traits:: normalize_param_env_or_error ( tcx, param_env, normalize_cause) ;
19521952 debug ! ( caller_bounds=?param_env. caller_bounds( ) ) ;
19531953
1954- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1954+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
19551955 let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
19561956
19571957 for ( predicate, span) in impl_ty_own_bounds {
@@ -2036,7 +2036,7 @@ pub(super) fn check_type_bounds<'tcx>(
20362036 let impl_ty_args = GenericArgs :: identity_for_item ( tcx, impl_ty. def_id ) ;
20372037 let rebased_args = impl_ty_args. rebase_onto ( tcx, container_id, impl_trait_ref. args ) ;
20382038
2039- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
2039+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
20402040 let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
20412041
20422042 // A synthetic impl Trait for RPITIT desugaring or assoc type for effects desugaring has no HIR,
0 commit comments