about summary refs log tree commit diff
path: root/tests/ui/traits/next-solver/normalize/normalize-param-env-2.rs
blob: bc387ff6d1cd7ea5ac4fc85ce9f1d41e187d3d1c (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
28
29
30
31
//@ compile-flags: -Znext-solver
//@ known-bug: #92505

// When checking that the impl method where-bounds are implied by the trait,
// we prove  `<() as A<T>>::Assoc: A<T>` in the environment `<() as A<T>>::Assoc: A<T>`.
//
// Normalizing `<() as A<T>>::Assoc` is ambiguous in that environment. The
// where-bound `<() as A<T>>::Assoc: A<T>` may apply, resulting in overflow.
trait A<T> {
    type Assoc;

    fn f()
    where
        Self::Assoc: A<T>,
    {
    }
}

impl<T> A<T> for () {
    type Assoc = ();

    fn f()
    where
        Self::Assoc: A<T>,
    {

        <() as A<T>>::f();
    }
}

fn main() {}