about summary refs log tree commit diff
path: root/tests/ui/traits/solver-cycles/129541-recursive-struct.rs
blob: c5c2c27b28267525083d810752a40f4a66b0e001 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//~ ERROR reached the recursion limit finding the struct tail for `<[Hello] as Normalize>::Assoc`
// Regression test for #129541

//@ revisions: unique_curr unique_next multiple_curr multiple_next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[unique_next] compile-flags: -Znext-solver
//@[multiple_next] compile-flags: -Znext-solver

trait Bound {}
trait Normalize {
    type Assoc;
}

#[cfg(any(multiple_curr, multiple_next))]
impl<T: Bound> Normalize for T {
    type Assoc = T;
}
impl<T: Bound> Normalize for [T] {
    type Assoc = T;
}

impl Bound for Hello {}
struct Hello {
    a: <[Hello] as Normalize>::Assoc,
}

fn main() {}