1
Fork 0

Rollup merge of #127146 - compiler-errors:fast-reject, r=lcnr

Uplift fast rejection to new solver

Self explanatory.

r? lcnr
This commit is contained in:
Matthias Krüger 2024-07-02 17:47:47 +02:00 committed by GitHub
commit 36da46ab98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 419 additions and 402 deletions

View file

@ -121,7 +121,7 @@ pub fn overlapping_impls(
// Before doing expensive operations like entering an inference context, do
// a quick check via fast_reject to tell if the impl headers could possibly
// unify.
let drcx = DeepRejectCtxt { treat_obligation_params: TreatParams::AsCandidateKey };
let drcx = DeepRejectCtxt::new(tcx, TreatParams::AsCandidateKey);
let impl1_ref = tcx.impl_trait_ref(impl1_def_id);
let impl2_ref = tcx.impl_trait_ref(impl2_def_id);
let may_overlap = match (impl1_ref, impl2_ref) {

View file

@ -571,7 +571,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
return;
}
let drcx = DeepRejectCtxt { treat_obligation_params: TreatParams::ForLookup };
let drcx = DeepRejectCtxt::new(self.tcx(), TreatParams::ForLookup);
let obligation_args = obligation.predicate.skip_binder().trait_ref.args;
self.tcx().for_each_relevant_impl(
obligation.predicate.def_id(),