about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2024-01-08 10:41:55 +0100
committerlcnr <rust@lcnr.de>2024-01-08 10:41:55 +0100
commiteb4d7c7adf55a7480a9ef3e3b990d015ef3ea07c (patch)
treefd83234fe1ba264a3bf4c6d19be488977eecdb95 /compiler/rustc_trait_selection/src
parent61d6b20cd87ac6bacc854482921f0a1ed80351e0 (diff)
downloadrust-eb4d7c7adf55a7480a9ef3e3b990d015ef3ea07c.tar.gz
rust-eb4d7c7adf55a7480a9ef3e3b990d015ef3ea07c.zip
`all` to `any`
don't really know why, but it is a lot easier for me to think
about cycles that way.
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/solve/search_graph.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/search_graph.rs b/compiler/rustc_trait_selection/src/solve/search_graph.rs
index 8a8221f85a4..523025cabe2 100644
--- a/compiler/rustc_trait_selection/src/solve/search_graph.rs
+++ b/compiler/rustc_trait_selection/src/solve/search_graph.rs
@@ -260,13 +260,13 @@ impl<'tcx> SearchGraph<'tcx> {
                 } else {
                     // If we don't have a provisional result yet we're in the first iteration,
                     // so we start with no constraints.
-                    let is_coinductive = self.stack.raw[stack_depth.index()..]
+                    let is_inductive = self.stack.raw[stack_depth.index()..]
                         .iter()
-                        .all(|entry| entry.input.value.goal.predicate.is_coinductive(tcx));
-                    if is_coinductive {
-                        Self::response_no_constraints(tcx, input, Certainty::Yes)
-                    } else {
+                        .any(|entry| !entry.input.value.goal.predicate.is_coinductive(tcx));
+                    if is_inductive {
                         Self::response_no_constraints(tcx, input, Certainty::OVERFLOW)
+                    } else {
+                        Self::response_no_constraints(tcx, input, Certainty::Yes)
                     }
                 };
             }