|
1 | 1 | use std::convert::Infallible; |
2 | 2 | use std::marker::PhantomData; |
3 | 3 |
|
| 4 | +use rustc_type_ir::Interner; |
4 | 5 | use rustc_type_ir::search_graph::{self, PathKind}; |
5 | 6 | use rustc_type_ir::solve::{AccessedOpaques, Certainty, NoSolution, QueryResult, RerunResultExt}; |
6 | | -use rustc_type_ir::{Interner, MayBeErased, TypingMode}; |
7 | 7 |
|
8 | 8 | use crate::canonical::response_no_constraints_raw; |
9 | 9 | use crate::delegate::SolverDelegate; |
@@ -52,29 +52,21 @@ where |
52 | 52 | PathKind::Unknown | PathKind::ForcedAmbiguity => { |
53 | 53 | response_no_constraints(cx, input, Certainty::overflow(false)) |
54 | 54 | } |
55 | | - // Even though we know these cycles to be unproductive, we still return |
56 | | - // overflow during coherence. This is both as we are not 100% confident in |
57 | | - // the implementation yet and any incorrect errors would be unsound there. |
| 55 | + // Even though we know some cycles to be unproductive, we still treat them |
| 56 | + // as unknown for now. This is both as we are not 100% confident in the |
| 57 | + // implementation yet and any incorrect errors would be unsound there. |
| 58 | + // |
58 | 59 | // The affected cases are also fairly artificial and not necessarily desirable |
59 | 60 | // so keeping this as ambiguity is fine for now. |
60 | 61 | // |
61 | | - // See `tests/ui/traits/next-solver/cycles/unproductive-in-coherence.rs` for an |
62 | | - // example where this would matter. We likely should change these cycles to `NoSolution` |
63 | | - // even in coherence once this is a bit more settled. |
64 | | - PathKind::Inductive => match input.typing_mode.0 { |
65 | | - TypingMode::Coherence => { |
66 | | - response_no_constraints(cx, input, Certainty::overflow(false)) |
67 | | - } |
68 | | - TypingMode::Typeck { .. } |
69 | | - | TypingMode::PostTypeckUntilBorrowck { .. } |
70 | | - | TypingMode::Reflection |
71 | | - | TypingMode::PostBorrowck { .. } |
72 | | - | TypingMode::PostAnalysis |
73 | | - | TypingMode::Codegen |
74 | | - | TypingMode::ErasedNotCoherence(MayBeErased) => { |
75 | | - (Err(NoSolution), AccessedOpaques::default()) |
76 | | - } |
77 | | - }, |
| 62 | + // See `tests/ui/traits/next-solver/cycles/unproductive-in-coherence.rs` and |
| 63 | + // `tests/ui/traits/next-solver/overflow/recursive-self-normalization-simple.rs` |
| 64 | + // for examples where this would matter. |
| 65 | + // |
| 66 | + // FIXME(-Znext-solver=coinductive): Long term, we probably do want to |
| 67 | + // return `NoSolution` here. This should happen separately from the |
| 68 | + // stabilization of the new solver. |
| 69 | + PathKind::Inductive => unreachable!(), |
78 | 70 | } |
79 | 71 | } |
80 | 72 |
|
|
0 commit comments