diff options
| author | lcnr <rust@lcnr.de> | 2025-09-26 13:48:22 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2025-09-26 15:29:01 +0200 |
| commit | 4a0c7cc730a5434574c41a6073d9efb92141af1a (patch) | |
| tree | fae2d074f884559e0c01b9eb7d0e8855b55958a9 /compiler/rustc_next_trait_solver | |
| parent | 5b9007bfc358817cf066ee27c6b440440727d3a7 (diff) | |
| download | rust-4a0c7cc730a5434574c41a6073d9efb92141af1a.tar.gz rust-4a0c7cc730a5434574c41a6073d9efb92141af1a.zip | |
fix cycle head usages tracking
Diffstat (limited to 'compiler/rustc_next_trait_solver')
| -rw-r--r-- | compiler/rustc_next_trait_solver/src/solve/search_graph.rs | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/compiler/rustc_next_trait_solver/src/solve/search_graph.rs b/compiler/rustc_next_trait_solver/src/solve/search_graph.rs index aa9dfc9a9a2..4ae2af59a70 100644 --- a/compiler/rustc_next_trait_solver/src/solve/search_graph.rs +++ b/compiler/rustc_next_trait_solver/src/solve/search_graph.rs @@ -74,13 +74,21 @@ where } } - fn is_initial_provisional_result( - cx: Self::Cx, - kind: PathKind, - input: CanonicalInput<I>, - result: QueryResult<I>, - ) -> bool { - Self::initial_provisional_result(cx, kind, input) == result + fn is_initial_provisional_result(result: QueryResult<I>) -> Option<PathKind> { + match result { + Ok(response) => { + if has_no_inference_or_external_constraints(response) { + if response.value.certainty == Certainty::Yes { + return Some(PathKind::Coinductive); + } else if response.value.certainty == Certainty::overflow(false) { + return Some(PathKind::Unknown); + } + } + + None + } + Err(NoSolution) => Some(PathKind::Inductive), + } } fn on_stack_overflow(cx: I, input: CanonicalInput<I>) -> QueryResult<I> { |
