diff options
| author | lcnr <rust@lcnr.de> | 2023-03-14 14:19:06 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2023-03-21 09:57:20 +0100 |
| commit | 791ce0b7b5d03649bc9014d5b0abb78f3c6f2cfd (patch) | |
| tree | 4a321c50deba262c65a0dc552fbfaca8cc70de14 /compiler/rustc_trait_selection/src/traits/select/mod.rs | |
| parent | 84c47b8279b39e165dfebeb529eb6d92592e4f8d (diff) | |
| download | rust-791ce0b7b5d03649bc9014d5b0abb78f3c6f2cfd.tar.gz rust-791ce0b7b5d03649bc9014d5b0abb78f3c6f2cfd.zip | |
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.
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/select/mod.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/mod.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index bc1c72da1e1..d9b2b7dbe16 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -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() |
