about summary refs log tree commit diff
path: root/tests/ui/typeck/method-chain-gats.rs
blob: c7081c9a3b16790e162c25ae9e8ee1579751653b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Regression test for issue #121898.

trait Base {
    type Base<B>;
}

trait Functor<A>: Base {
    fn fmap<B>(self, f: impl Fn(A) -> B) -> Self::Base<B>
    where
        Self::Base<B>: Functor<B>;
}

fn fmap2<T, A, B, C>(input: T, f1: impl Fn(A) -> B, f2: impl Fn(B) -> C) -> T::Base<C>
where
    T: Functor<A>,
    T::Base<B>: Functor<B, Base<C> = T::Base<C>>,
{
    input.fmap(f1).fmap(f2)
    //~^ ERROR the trait bound `<T as Base>::Base<C>: Functor<C>` is not satisfied
}

fn main() {}