|
1 | 1 | use std::convert::Infallible; |
2 | 2 | use std::marker::PhantomData; |
3 | 3 |
|
4 | | -use rustc_type_ir::Interner; |
5 | | -use rustc_type_ir::inherent::*; |
6 | 4 | use rustc_type_ir::search_graph::{self, PathKind}; |
7 | | -use rustc_type_ir::solve::{CanonicalInput, Certainty, QueryResult}; |
| 5 | +use rustc_type_ir::solve::{CanonicalInput, Certainty, NoSolution, QueryResult}; |
| 6 | +use rustc_type_ir::{Interner, TypingMode}; |
8 | 7 |
|
9 | 8 | use super::inspect::ProofTreeBuilder; |
10 | 9 | use super::{FIXPOINT_STEP_LIMIT, has_no_inference_or_external_constraints}; |
|
48 | 47 | ) -> QueryResult<I> { |
49 | 48 | match kind { |
50 | 49 | PathKind::Coinductive => response_no_constraints(cx, input, Certainty::Yes), |
51 | | - PathKind::Inductive => response_no_constraints(cx, input, Certainty::overflow(false)), |
| 50 | + PathKind::Inductive => match input.typing_mode { |
| 51 | + TypingMode::Coherence => { |
| 52 | + response_no_constraints(cx, input, Certainty::overflow(false)) |
| 53 | + } |
| 54 | + TypingMode::Analysis { .. } |
| 55 | + | TypingMode::PostBorrowckAnalysis { .. } |
| 56 | + | TypingMode::PostAnalysis => Err(NoSolution), |
| 57 | + }, |
52 | 58 | } |
53 | 59 | } |
54 | 60 |
|
|
58 | 64 | input: CanonicalInput<I>, |
59 | 65 | result: QueryResult<I>, |
60 | 66 | ) -> bool { |
61 | | - match kind { |
62 | | - PathKind::Coinductive => response_no_constraints(cx, input, Certainty::Yes) == result, |
63 | | - PathKind::Inductive => { |
64 | | - response_no_constraints(cx, input, Certainty::overflow(false)) == result |
65 | | - } |
66 | | - } |
| 67 | + Self::initial_provisional_result(cx, kind, input) == result |
67 | 68 | } |
68 | 69 |
|
69 | 70 | fn on_stack_overflow( |
|
0 commit comments