@@ -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 ;
@@ -209,7 +209,7 @@ fn compare_method_predicate_entailment<'tcx>(
209
209
let param_env = traits:: normalize_param_env_or_error ( tcx, param_env, normalize_cause) ;
210
210
debug ! ( caller_bounds=?param_env. caller_bounds( ) ) ;
211
211
212
- let infcx = & tcx. infer_ctxt ( ) . build ( ) ;
212
+ let infcx = & tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
213
213
let ocx = ObligationCtxt :: new_with_diagnostics ( infcx) ;
214
214
215
215
// 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>(
469
469
ObligationCause :: misc ( tcx. def_span ( impl_m_def_id) , impl_m_def_id) ,
470
470
) ;
471
471
472
- let infcx = & tcx. infer_ctxt ( ) . build ( ) ;
472
+ let infcx = & tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
473
473
let ocx = ObligationCtxt :: new_with_diagnostics ( infcx) ;
474
474
475
475
// Normalize the impl signature with fresh variables for lifetime inference.
@@ -1149,7 +1149,7 @@ fn compare_self_type<'tcx>(
1149
1149
let self_arg_ty = tcx. fn_sig ( method. def_id ) . instantiate_identity ( ) . input ( 0 ) ;
1150
1150
let param_env = ty:: ParamEnv :: reveal_all ( ) ;
1151
1151
1152
- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1152
+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
1153
1153
let self_arg_ty = tcx. liberate_late_bound_regions ( method. def_id , self_arg_ty) ;
1154
1154
let can_eq_self = |ty| infcx. can_eq ( param_env, untransformed_self_ty, ty) ;
1155
1155
match ExplicitSelf :: determine ( self_arg_ty, can_eq_self) {
@@ -1754,7 +1754,7 @@ fn compare_const_predicate_entailment<'tcx>(
1754
1754
ObligationCause :: misc ( impl_ct_span, impl_ct_def_id) ,
1755
1755
) ;
1756
1756
1757
- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1757
+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
1758
1758
let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
1759
1759
1760
1760
let impl_ct_own_bounds = impl_ct_predicates. instantiate_own_identity ( ) ;
@@ -1885,7 +1885,7 @@ fn compare_type_predicate_entailment<'tcx>(
1885
1885
let param_env = traits:: normalize_param_env_or_error ( tcx, param_env, normalize_cause) ;
1886
1886
debug ! ( caller_bounds=?param_env. caller_bounds( ) ) ;
1887
1887
1888
- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1888
+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
1889
1889
let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
1890
1890
1891
1891
for ( predicate, span) in impl_ty_own_bounds {
@@ -1947,7 +1947,7 @@ pub(super) fn check_type_bounds<'tcx>(
1947
1947
let impl_ty_args = GenericArgs :: identity_for_item ( tcx, impl_ty. def_id ) ;
1948
1948
let rebased_args = impl_ty_args. rebase_onto ( tcx, container_id, impl_trait_ref. args ) ;
1949
1949
1950
- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
1950
+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
1951
1951
let ocx = ObligationCtxt :: new_with_diagnostics ( & infcx) ;
1952
1952
1953
1953
// A synthetic impl Trait for RPITIT desugaring or assoc type for effects desugaring has no HIR,
0 commit comments