1
Fork 0

Better names?

This commit is contained in:
Michael Goulet 2023-03-12 00:59:54 +00:00
parent 868aa42f4b
commit 84d254ead0
16 changed files with 55 additions and 49 deletions

View file

@ -184,7 +184,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> {
let goal_trait_ref = goal.predicate.projection_ty.trait_ref(tcx);
let impl_trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap();
let drcx = DeepRejectCtxt { treat_obligation_params: TreatParams::AsPlaceholder };
let drcx = DeepRejectCtxt { treat_obligation_params: TreatParams::ForLookup };
if iter::zip(goal_trait_ref.substs, impl_trait_ref.skip_binder().substs)
.any(|(goal, imp)| !drcx.generic_args_may_unify(goal, imp))
{

View file

@ -36,7 +36,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
let tcx = ecx.tcx();
let impl_trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap();
let drcx = DeepRejectCtxt { treat_obligation_params: TreatParams::AsPlaceholder };
let drcx = DeepRejectCtxt { treat_obligation_params: TreatParams::ForLookup };
if iter::zip(goal.predicate.trait_ref.substs, impl_trait_ref.skip_binder().substs)
.any(|(goal, imp)| !drcx.generic_args_may_unify(goal, imp))
{

View file

@ -75,7 +75,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::AsInfer };
let drcx = DeepRejectCtxt { treat_obligation_params: 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

@ -1803,7 +1803,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
self.tcx.find_map_relevant_impl(
id,
proj.projection_ty.self_ty(),
TreatProjections::DefaultLookup,
TreatProjections::ForLookup,
|did| {
self.tcx
.associated_items(did)
@ -2185,7 +2185,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
self.tcx.find_map_relevant_impl(
trait_def_id,
trait_ref.skip_binder().self_ty(),
TreatProjections::DefaultLookup,
TreatProjections::ForLookup,
Some,
)
};

View file

@ -784,7 +784,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
let relevant_impl = self.tcx().find_map_relevant_impl(
self.tcx().require_lang_item(LangItem::Drop, None),
obligation.predicate.skip_binder().trait_ref.self_ty(),
TreatProjections::DefaultLookup,
TreatProjections::ForLookup,
Some,
);

View file

@ -2558,7 +2558,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
// We can avoid creating type variables and doing the full
// substitution if we find that any of the input types, when
// simplified, do not match.
let drcx = DeepRejectCtxt { treat_obligation_params: TreatParams::AsPlaceholder };
let drcx = DeepRejectCtxt { treat_obligation_params: TreatParams::ForLookup };
iter::zip(obligation.predicate.skip_binder().trait_ref.substs, impl_trait_ref.substs)
.any(|(obl, imp)| !drcx.generic_args_may_unify(obl, imp))
}

View file

@ -52,8 +52,8 @@ impl<'tcx> ChildrenExt<'tcx> for Children {
if let Some(st) = fast_reject::simplify_type(
tcx,
trait_ref.self_ty(),
TreatParams::AsInfer,
fast_reject::TreatProjections::DefaultCandidate,
TreatParams::AsCandidateKey,
TreatProjections::AsCandidateKey,
) {
debug!("insert_blindly: impl_def_id={:?} st={:?}", impl_def_id, st);
self.non_blanket_impls.entry(st).or_default().push(impl_def_id)
@ -72,8 +72,8 @@ impl<'tcx> ChildrenExt<'tcx> for Children {
if let Some(st) = fast_reject::simplify_type(
tcx,
trait_ref.self_ty(),
TreatParams::AsInfer,
TreatProjections::DefaultCandidate,
TreatParams::AsCandidateKey,
TreatProjections::AsCandidateKey,
) {
debug!("remove_existing: impl_def_id={:?} st={:?}", impl_def_id, st);
vec = self.non_blanket_impls.get_mut(&st).unwrap();
@ -313,8 +313,8 @@ impl<'tcx> GraphExt<'tcx> for Graph {
let simplified = fast_reject::simplify_type(
tcx,
trait_ref.self_ty(),
TreatParams::AsInfer,
TreatProjections::DefaultCandidate,
TreatParams::AsCandidateKey,
TreatProjections::AsCandidateKey,
);
// Descend the specialization tree, where `parent` is the current parent node.