]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-59494.rs
Enable full revision in const generics ui tests
[rust.git] / src / test / ui / issues / issue-59494.rs
1 fn t7p<A, B, C>(f: impl Fn(B) -> C, g: impl Fn(A) -> B) -> impl Fn(A) -> C {
2     move |a: A| -> C { f(g(a)) }
3 }
4
5 fn t8n<A, B, C>(f: impl Fn(A) -> B, g: impl Fn(A) -> C) -> impl Fn(A) -> (B, C)
6 where
7     A: Copy,
8 {
9     move |a: A| -> (B, C) {
10         let b = a;
11         let fa = f(a);
12         let ga = g(b);
13         (fa, ga)
14     }
15 }
16
17 fn main() {
18     let f = |(_, _)| {};
19     let g = |(a, _)| a;
20     let t7 = |env| |a| |b| t7p(f, g)(((env, a), b));
21     let t8 = t8n(t7, t7p(f, g));
22     //~^ ERROR: expected a `Fn<(_,)>` closure, found `impl Fn(((_, _), _))` [E0277]
23 }