Open
Description
This works fine:
trait Foo {}
impl<F, A> Foo for F where F: Fn() -> A {}
But this:
trait Foo {}
impl<F, A> Foo for F where F: Fn(A) {}
produces a compile error:
<anon>:2:9: 2:10 error: the type parameter `A` is not constrained by the impl trait, self type, or predicates [E0207]
<anon>:2 impl<F, A> Foo for F where F: Fn(A) {}
I'm not sure if this is intended behavior or not, but I definitely don't understand why the former is accepted and the latter is not.
Version:
[andrew@Liger quickcheck] rustc --version
rustc 1.1.0-nightly (c4b23aec4 2015-04-29) (built 2015-04-29)
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsCategory: An issue proposing an enhancement or a PR with one.Diagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint; hard to understand for new users.`#![feature(unboxed_closures)]`Relevant to the compiler team, which will review and decide on the PR/issue.