@@ -21,7 +21,7 @@ use rustc_hir::lang_items::LangItem;
2121use rustc_hir:: { self as hir, ExprKind , HirId , Node , PathSegment , QPath } ;
2222use rustc_infer:: infer:: { self , RegionVariableOrigin } ;
2323use rustc_middle:: bug;
24- use rustc_middle:: ty:: fast_reject:: { simplify_type, DeepRejectCtxt , TreatParams } ;
24+ use rustc_middle:: ty:: fast_reject:: { new_reject_ctxt , simplify_type, DeepRejectCtxt , TreatParams } ;
2525use rustc_middle:: ty:: print:: {
2626 with_crate_prefix, with_forced_trimmed_paths, PrintTraitRefExt as _,
2727} ;
@@ -2234,7 +2234,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
22342234 let target_ty = self
22352235 . autoderef ( sugg_span, rcvr_ty)
22362236 . find ( |( rcvr_ty, _) | {
2237- DeepRejectCtxt :: new ( self . tcx , TreatParams :: ForLookup )
2237+ new_reject_ctxt ! ( self . tcx, AsRigid , InstantiateWithInfer )
22382238 . types_may_unify ( * rcvr_ty, impl_ty)
22392239 } )
22402240 . map_or ( impl_ty, |( ty, _) | ty)
@@ -2497,7 +2497,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
24972497 . into_iter ( )
24982498 . any ( |info| self . associated_value ( info. def_id , item_name) . is_some ( ) ) ;
24992499 let found_assoc = |ty : Ty < ' tcx > | {
2500- simplify_type ( tcx, ty, TreatParams :: AsCandidateKey )
2500+ simplify_type ( tcx, ty, TreatParams :: InstantiateWithInfer )
25012501 . and_then ( |simp| {
25022502 tcx. incoherent_impls ( simp)
25032503 . into_iter ( )
@@ -3927,7 +3927,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
39273927 // cases where a positive bound implies a negative impl.
39283928 ( candidates, Vec :: new ( ) )
39293929 } else if let Some ( simp_rcvr_ty) =
3930- simplify_type ( self . tcx , rcvr_ty, TreatParams :: ForLookup )
3930+ simplify_type ( self . tcx , rcvr_ty, TreatParams :: AsRigid )
39313931 {
39323932 let mut potential_candidates = Vec :: new ( ) ;
39333933 let mut explicitly_negative = Vec :: new ( ) ;
@@ -3945,7 +3945,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
39453945 . any ( |header| {
39463946 let imp = header. trait_ref . instantiate_identity ( ) ;
39473947 let imp_simp =
3948- simplify_type ( self . tcx , imp. self_ty ( ) , TreatParams :: ForLookup ) ;
3948+ simplify_type ( self . tcx , imp. self_ty ( ) , TreatParams :: AsRigid ) ;
39493949 imp_simp. is_some_and ( |s| s == simp_rcvr_ty)
39503950 } )
39513951 {
0 commit comments