-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
type_alias_impl_trait is unusable #3079
Comments
That isn't a complete snippet, you also need a defining use, i.e. a function return type. #![feature(type_alias_impl_trait)]
type Adder = impl Fn(usize) -> usize;
fn adder() -> Adder { /* snip */ } |
I try this #![feature(type_alias_impl_trait)]
fn main() {}
type Adder = impl Fn(usize) -> usize;
fn doit() -> Adder {
func
}
fn func(n: usize) -> usize {
n
} now cargo check doesn't report errors, but why I have to use it? |
I think this will be easier to understand via analogy. 1 - does not compile
|
It looks like this is working as expected, then, so I'll close this issue. |
this codes should be right like #2515 (comment)
but now cargo check report error
the cargo version is cargo 1.51.0-nightly (ab64d1393 2021-02-10)
The text was updated successfully, but these errors were encountered: