@@ -21,7 +21,7 @@ use rustc_hir::lang_items::LangItem;
21
21
use rustc_hir:: { self as hir, ExprKind , HirId , Node , PathSegment , QPath } ;
22
22
use rustc_infer:: infer:: { self , RegionVariableOrigin } ;
23
23
use 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 } ;
25
25
use rustc_middle:: ty:: print:: {
26
26
with_crate_prefix, with_forced_trimmed_paths, PrintTraitRefExt as _,
27
27
} ;
@@ -2234,7 +2234,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
2234
2234
let target_ty = self
2235
2235
. autoderef ( sugg_span, rcvr_ty)
2236
2236
. find ( |( rcvr_ty, _) | {
2237
- DeepRejectCtxt :: new ( self . tcx , TreatParams :: ForLookup )
2237
+ new_reject_ctxt ! ( self . tcx, AsRigid , InstantiateWithInfer )
2238
2238
. types_may_unify ( * rcvr_ty, impl_ty)
2239
2239
} )
2240
2240
. map_or ( impl_ty, |( ty, _) | ty)
@@ -2497,7 +2497,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
2497
2497
. into_iter ( )
2498
2498
. any ( |info| self . associated_value ( info. def_id , item_name) . is_some ( ) ) ;
2499
2499
let found_assoc = |ty : Ty < ' tcx > | {
2500
- simplify_type ( tcx, ty, TreatParams :: AsCandidateKey )
2500
+ simplify_type ( tcx, ty, TreatParams :: InstantiateWithInfer )
2501
2501
. and_then ( |simp| {
2502
2502
tcx. incoherent_impls ( simp)
2503
2503
. into_iter ( )
@@ -3927,7 +3927,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3927
3927
// cases where a positive bound implies a negative impl.
3928
3928
( candidates, Vec :: new ( ) )
3929
3929
} 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 )
3931
3931
{
3932
3932
let mut potential_candidates = Vec :: new ( ) ;
3933
3933
let mut explicitly_negative = Vec :: new ( ) ;
@@ -3945,7 +3945,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3945
3945
. any ( |header| {
3946
3946
let imp = header. trait_ref . instantiate_identity ( ) ;
3947
3947
let imp_simp =
3948
- simplify_type ( self . tcx , imp. self_ty ( ) , TreatParams :: ForLookup ) ;
3948
+ simplify_type ( self . tcx , imp. self_ty ( ) , TreatParams :: AsRigid ) ;
3949
3949
imp_simp. is_some_and ( |s| s == simp_rcvr_ty)
3950
3950
} )
3951
3951
{
0 commit comments