about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-11-02 04:09:01 +0000
committerMichael Goulet <michael@errs.io>2022-11-02 04:11:05 +0000
commit41e4218d2a218896d9acde3ab68d7862b56b7f54 (patch)
tree6d58078e2eaec07fed965c2203dd3c9bc6aa9e6f /compiler/rustc_trait_selection/src/traits
parent11ebe6512b4c77633c59f8dcdd421df3b79d1a9f (diff)
downloadrust-41e4218d2a218896d9acde3ab68d7862b56b7f54.tar.gz
rust-41e4218d2a218896d9acde3ab68d7862b56b7f54.zip
Use TraitEngine less
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
-rw-r--r--compiler/rustc_trait_selection/src/traits/outlives_bounds.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/outlives_bounds.rs b/compiler/rustc_trait_selection/src/traits/outlives_bounds.rs
index 108dae092cf..b1a161c3536 100644
--- a/compiler/rustc_trait_selection/src/traits/outlives_bounds.rs
+++ b/compiler/rustc_trait_selection/src/traits/outlives_bounds.rs
@@ -1,7 +1,7 @@
 use crate::infer::InferCtxt;
 use crate::traits::query::type_op::{self, TypeOp, TypeOpOutput};
 use crate::traits::query::NoSolution;
-use crate::traits::{ObligationCause, TraitEngine, TraitEngineExt};
+use crate::traits::ObligationCause;
 use rustc_data_structures::fx::FxHashSet;
 use rustc_hir as hir;
 use rustc_hir::HirId;
@@ -74,20 +74,20 @@ impl<'a, 'tcx: 'a> InferCtxtExt<'a, 'tcx> for InferCtxt<'tcx> {
             debug!(?constraints);
             // Instantiation may have produced new inference variables and constraints on those
             // variables. Process these constraints.
-            let mut fulfill_cx = <dyn TraitEngine<'tcx>>::new(self.tcx);
             let cause = ObligationCause::misc(span, body_id);
-            for &constraint in &constraints.outlives {
-                let obligation = self.query_outlives_constraint_to_obligation(
-                    constraint,
-                    cause.clone(),
-                    param_env,
-                );
-                fulfill_cx.register_predicate_obligation(self, obligation);
-            }
+            let errors = super::fully_solve_obligations(
+                self,
+                constraints.outlives.iter().map(|constraint| {
+                    self.query_outlives_constraint_to_obligation(
+                        *constraint,
+                        cause.clone(),
+                        param_env,
+                    )
+                }),
+            );
             if !constraints.member_constraints.is_empty() {
                 span_bug!(span, "{:#?}", constraints.member_constraints);
             }
-            let errors = fulfill_cx.select_all_or_error(self);
             if !errors.is_empty() {
                 self.tcx.sess.delay_span_bug(
                     span,