Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

ices/59494.rs: fixed with errors #513

Merged
merged 1 commit into from
Oct 23, 2020
Merged

ices/59494.rs: fixed with errors #513

merged 1 commit into from
Oct 23, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#59494

fn t7p<A,B,C>( f:impl Fn(B) -> C, g:impl Fn(A) -> B ) -> impl Fn(A) -> C
{
  move |a:A| -> C { f(g(a)) }
}

fn t8n<A,B,C>( f:impl Fn(A) -> B, g:impl Fn(A) -> C ) -> impl Fn(A) -> (B,C)
  where
    A: Copy
{
  move |a:A| -> (B,C) {
    let b = a;
    let fa = f(a);
    let ga = g(b);
    (fa, ga)
  }
}

fn main() {

  let f = |(_,_)| {  };
  let g = |(a,_)| { a };
  let t7 = |env| { |a| { |b| {  t7p(f, g)(((env,a),b))  }}};
  let t8 = t8n(t7, t7p(f, g));
}
=== stdout ===
=== stderr ===
error[E0277]: expected a `Fn<(_,)>` closure, found `impl Fn<(((_, _), _),)>`
  --> /home/runner/work/glacier/glacier/ices/59494.rs:23:20
   |
6  | fn t8n<A,B,C>( f:impl Fn(A) -> B, g:impl Fn(A) -> C ) -> impl Fn(A) -> (B,C)
   |                                          ---------- required by this bound in `t8n`
...
23 |   let t8 = t8n(t7, t7p(f, g));
   |                    ^^^^^^^^^ expected an `Fn<(_,)>` closure, found `impl Fn<(((_, _), _),)>`
   |
   = help: the trait `Fn<(_,)>` is not implemented for `impl Fn<(((_, _), _),)>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
==============

=== stdout ===
=== stderr ===
error[E0277]: expected a `Fn<(_,)>` closure, found `impl Fn<(((_, _), _),)>`
  --> /home/runner/work/glacier/glacier/ices/59494.rs:23:20
   |
6  | fn t8n<A,B,C>( f:impl Fn(A) -> B, g:impl Fn(A) -> C ) -> impl Fn(A) -> (B,C)
   |                                          ---------- required by this bound in `t8n`
...
23 |   let t8 = t8n(t7, t7p(f, g));
   |                    ^^^^^^^^^ expected an `Fn<(_,)>` closure, found `impl Fn<(((_, _), _),)>`
   |
   = help: the trait `Fn<(_,)>` is not implemented for `impl Fn<(((_, _), _),)>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
==============
@Alexendoo Alexendoo merged commit 5965512 into master Oct 23, 2020
@Alexendoo Alexendoo deleted the autofix/ices/59494.rs branch October 23, 2020 16:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants