remove some trait solver helpers

they add more complexity then they are worth. It's confusing
which of these helpers should be used in which context.
This commit is contained in:
lcnr
2023-03-14 14:19:06 +01:00
parent 84c47b8279
commit 791ce0b7b5
31 changed files with 199 additions and 289 deletions

View File

@@ -17,7 +17,7 @@ use super::project;
use super::project::normalize_with_depth_to;
use super::project::ProjectionTyObligation;
use super::util;
use super::util::{closure_trait_ref_and_return_type, predicate_for_trait_def};
use super::util::closure_trait_ref_and_return_type;
use super::wf;
use super::{
ErrorReporting, ImplDerivedObligation, ImplDerivedObligationCause, Normalized, Obligation,
@@ -2440,15 +2440,14 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
placeholder_ty,
)
});
let placeholder_obligation = predicate_for_trait_def(
let obligation = Obligation::new(
self.tcx(),
param_env,
cause.clone(),
trait_def_id,
recursion_depth,
[normalized_ty],
param_env,
self.tcx().mk_trait_ref(trait_def_id, [normalized_ty]),
);
obligations.push(placeholder_obligation);
obligations.push(obligation);
obligations
})
.collect()