about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/autoderef.rs
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2025-05-30 11:21:34 +0000
committerlcnr <rust@lcnr.de>2025-06-03 14:23:56 +0200
commit7dac755be8d09234afa0ac6c3626c8d5f733ef31 (patch)
treee9ac8e1f028a3f63e306168da3769470b3c489d7 /compiler/rustc_hir_analysis/src/autoderef.rs
parentc68032fd4c442d275f4daa571ba19c076106b490 (diff)
downloadrust-7dac755be8d09234afa0ac6c3626c8d5f733ef31.tar.gz
rust-7dac755be8d09234afa0ac6c3626c8d5f733ef31.zip
`FIXME(-Znext-solver)` triage
Co-authored-by: Michael Goulet <michael@errs.io>
Diffstat (limited to 'compiler/rustc_hir_analysis/src/autoderef.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/autoderef.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rustc_hir_analysis/src/autoderef.rs b/compiler/rustc_hir_analysis/src/autoderef.rs
index 99e495d9266..c88c534e135 100644
--- a/compiler/rustc_hir_analysis/src/autoderef.rs
+++ b/compiler/rustc_hir_analysis/src/autoderef.rs
@@ -160,7 +160,7 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
             self.param_env,
             ty::Binder::dummy(trait_ref),
         );
-        if !self.infcx.predicate_may_hold(&obligation) {
+        if !self.infcx.next_trait_solver() && !self.infcx.predicate_may_hold(&obligation) {
             debug!("overloaded_deref_ty: cannot match obligation");
             return None;
         }
@@ -184,17 +184,17 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
             self.param_env,
             ty,
         ) else {
-            // We shouldn't have errors here, except for evaluate/fulfill mismatches,
-            // but that's not a reason for an ICE (`predicate_may_hold` is conservative
-            // by design).
-            // FIXME(-Znext-solver): This *actually* shouldn't happen then.
+            // We shouldn't have errors here in the old solver, except for
+            // evaluate/fulfill mismatches, but that's not a reason for an ICE.
             return None;
         };
         let errors = ocx.select_where_possible();
         if !errors.is_empty() {
-            // This shouldn't happen, except for evaluate/fulfill mismatches,
-            // but that's not a reason for an ICE (`predicate_may_hold` is conservative
-            // by design).
+            if self.infcx.next_trait_solver() {
+                unreachable!();
+            }
+            // We shouldn't have errors here in the old solver, except for
+            // evaluate/fulfill mismatches, but that's not a reason for an ICE.
             debug!(?errors, "encountered errors while fulfilling");
             return None;
         }