Skip to content

Commit fab2e8e

Browse files
committed
Added comments
1 parent fcddf7f commit fab2e8e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,10 @@ where
12611261
D: SolverDelegate<Interner = I>,
12621262
I: Interner,
12631263
{
1264+
// - `Continue(())`: no generic parameter was found, the type is global
1265+
// - `Break(Ok(Certainty::Yes))`: a generic parameter was found, the type is non-global
1266+
// - `Break(Ok(Certainty::Maybe(_)))`: the recursion limit reached, assume that the type is non-global
1267+
// - `Break(Err(NoSolution))`: normalization failed
12641268
type Result = ControlFlow<Result<Certainty, NoSolution>>;
12651269

12661270
fn visit_binder<T: TypeVisitable<I>>(&mut self, t: &ty::Binder<I, T>) -> Self::Result {

tests/ui/traits/next-solver/find-param-recursion-issue-152716.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
//@ compile-flags: -Znext-solver
22

33
// Regression test for <https://github.com/rust-lang/rust/issues/152716>.
4+
//
5+
// This test checks that we hit the recursion limit for recursively defined projections.
6+
// Normalization of `<T as Proj<'b>>::Assoc` could introduce the same projection again.
7+
// Previously, we get into an infinite recursion.
48

59
trait Trait<T> {}
610
trait Proj<'a> {

0 commit comments

Comments
 (0)