]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-79636-1.rs
Move some tests with compare-mode=nll output to revisions
[rust.git] / src / test / ui / generic-associated-types / issue-79636-1.rs
1 #![feature(generic_associated_types)]
2
3 trait Monad {
4     type Unwrapped;
5     type Wrapped<B>;
6
7     fn bind<B, F>(self, f: F) -> Self::Wrapped<B> {
8         todo!()
9     }
10 }
11
12 fn join<MOuter, MInner, A>(outer: MOuter) -> MOuter::Wrapped<A>
13 where
14     MOuter: Monad<Unwrapped = MInner>,
15     MInner: Monad<Unwrapped = A, Wrapped = MOuter::Wrapped<A>>,
16     //~^ ERROR: missing generics for associated type `Monad::Wrapped`
17 {
18     outer.bind(|inner| inner)
19 }
20
21 fn main() {
22     assert_eq!(join(Some(Some(true))), Some(true));
23 }