@@ -17,7 +17,7 @@ use rustc_middle::ty::fold::BottomUpFolder;
17
17
use rustc_middle:: ty:: util:: ExplicitSelf ;
18
18
use rustc_middle:: ty:: {
19
19
self , GenericArgs , GenericParamDefKind , Ty , TyCtxt , TypeFoldable , TypeFolder ,
20
- TypeSuperFoldable , TypeVisitableExt , Upcast ,
20
+ TypeSuperFoldable , TypeVisitableExt , TypingMode , Upcast ,
21
21
} ;
22
22
use rustc_middle:: { bug, span_bug} ;
23
23
use rustc_span:: Span ;
@@ -224,7 +224,7 @@ fn compare_method_predicate_entailment<'tcx>(
224
224
let param_env = ty:: ParamEnv :: new ( tcx. mk_clauses ( & hybrid_preds. predicates ) , Reveal :: UserFacing ) ;
225
225
let param_env = traits:: normalize_param_env_or_error ( tcx, param_env, normalize_cause) ;
226
226
227
- let infcx = & tcx. infer_ctxt ( ) . build ( ) ;
227
+ let infcx = & tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
228
228
let ocx = ObligationCtxt :: new_with_diagnostics ( infcx) ;
229
229
230
230
debug ! ( "compare_impl_method: caller_bounds={:?}" , param_env. caller_bounds( ) ) ;
@@ -486,7 +486,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
486
486
ObligationCause :: misc ( tcx. def_span ( impl_m_def_id) , impl_m_def_id) ,
487
487
) ;
488
488
489
- let infcx = & tcx. infer_ctxt ( ) . build ( ) ;
489
+ let infcx = & tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
490
490
let ocx = ObligationCtxt :: new_with_diagnostics ( infcx) ;
491
491
492
492
// Normalize the impl signature with fresh variables for lifetime inference.
@@ -1169,7 +1169,7 @@ fn compare_self_type<'tcx>(
1169
1169
let self_arg_ty = tcx. fn_sig ( method. def_id ) . instantiate_identity ( ) . input ( 0 ) ;
1170
1170
let param_env = ty:: ParamEnv :: reveal_all ( ) ;
1171
1171
1172
- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1172
+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
1173
1173
let self_arg_ty = tcx. liberate_late_bound_regions ( method. def_id , self_arg_ty) ;
1174
1174
let can_eq_self = |ty| infcx. can_eq ( param_env, untransformed_self_ty, ty) ;
1175
1175
match ExplicitSelf :: determine ( self_arg_ty, can_eq_self) {
@@ -1773,7 +1773,7 @@ fn compare_const_predicate_entailment<'tcx>(
1773
1773
ObligationCause :: misc ( impl_ct_span, impl_ct_def_id) ,
1774
1774
) ;
1775
1775
1776
- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1776
+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
1777
1777
let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
1778
1778
1779
1779
let impl_ct_own_bounds = impl_ct_predicates. instantiate_own ( tcx, impl_args) ;
@@ -1905,7 +1905,7 @@ fn compare_type_predicate_entailment<'tcx>(
1905
1905
let normalize_cause = ObligationCause :: misc ( impl_ty_span, impl_ty_def_id) ;
1906
1906
let param_env = ty:: ParamEnv :: new ( tcx. mk_clauses ( & hybrid_preds. predicates ) , Reveal :: UserFacing ) ;
1907
1907
let param_env = traits:: normalize_param_env_or_error ( tcx, param_env, normalize_cause) ;
1908
- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1908
+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
1909
1909
let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
1910
1910
1911
1911
debug ! ( "compare_type_predicate_entailment: caller_bounds={:?}" , param_env. caller_bounds( ) ) ;
@@ -1969,7 +1969,7 @@ pub(super) fn check_type_bounds<'tcx>(
1969
1969
let impl_ty_args = GenericArgs :: identity_for_item ( tcx, impl_ty. def_id ) ;
1970
1970
let rebased_args = impl_ty_args. rebase_onto ( tcx, container_id, impl_trait_ref. args ) ;
1971
1971
1972
- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1972
+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
1973
1973
let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
1974
1974
1975
1975
// A synthetic impl Trait for RPITIT desugaring or assoc type for effects desugaring has no HIR,
0 commit comments