about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits/mod.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-03-19 17:53:43 +0000
committerMichael Goulet <michael@errs.io>2025-04-23 18:04:25 +0000
commit257f68777f469bdd26d4763dc0cbd99c99b74e1d (patch)
tree07ac0b5e8b6931c5ccf470de705404cfcf84752b /compiler/rustc_trait_selection/src/traits/mod.rs
parentbe181dd75c83d72fcc95538e235768bc367b76b9 (diff)
downloadrust-257f68777f469bdd26d4763dc0cbd99c99b74e1d.tar.gz
rust-257f68777f469bdd26d4763dc0cbd99c99b74e1d.zip
Use the new solver in the impossible_predicates
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/mod.rs')
-rw-r--r--compiler/rustc_trait_selection/src/traits/mod.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs
index 0987c5b42d8..7a744dfc2ad 100644
--- a/compiler/rustc_trait_selection/src/traits/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/mod.rs
@@ -690,8 +690,11 @@ fn replace_param_and_infer_args_with_placeholder<'tcx>(
 /// used during analysis.
 pub fn impossible_predicates<'tcx>(tcx: TyCtxt<'tcx>, predicates: Vec<ty::Clause<'tcx>>) -> bool {
     debug!("impossible_predicates(predicates={:?})", predicates);
-    let (infcx, param_env) =
-        tcx.infer_ctxt().build_with_typing_env(ty::TypingEnv::fully_monomorphized());
+    let (infcx, param_env) = tcx
+        .infer_ctxt()
+        .with_next_trait_solver(true)
+        .build_with_typing_env(ty::TypingEnv::fully_monomorphized());
+
     let ocx = ObligationCtxt::new(&infcx);
     let predicates = ocx.normalize(&ObligationCause::dummy(), param_env, predicates);
     for predicate in predicates {
@@ -704,13 +707,6 @@ pub fn impossible_predicates<'tcx>(tcx: TyCtxt<'tcx>, predicates: Vec<ty::Clause
         return true;
     }
 
-    // Leak check for any higher-ranked trait mismatches.
-    // We only need to do this in the old solver, since the new solver already
-    // leak-checks.
-    if !infcx.next_trait_solver() && infcx.leak_check(ty::UniverseIndex::ROOT, None).is_err() {
-        return true;
-    }
-
     false
 }