Skip to content
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

lifetime elision should apply to closure types #18637

Closed
comex opened this issue Nov 4, 2014 · 2 comments
Closed

lifetime elision should apply to closure types #18637

comex opened this issue Nov 4, 2014 · 2 comments

Comments

@comex
Copy link
Contributor

comex commented Nov 4, 2014

fn help(f: fn(a: &int, b: &int) -> int) {} // OK
fn help2<F: Fn(&int, &int) -> int>(f: F) {} // error

->

hhh.rs:3:16: 3:20 error: missing lifetime specifier [E0106]
hhh.rs:3 fn help2<F: Fn(&int, &int) -> int>(f: F) {}
                        ^~~~
hhh.rs:3:22: 3:26 error: missing lifetime specifier [E0106]
hhh.rs:3 fn help2<F: Fn(&int, &int) -> int>(f: F) {}
                              ^~~~

It seems like it can't possibly be right that this would work for one but not the other.

@huonw
Copy link
Member

huonw commented Nov 4, 2014

Covered by rust-lang/rfcs#387.

@comex
Copy link
Contributor Author

comex commented Nov 4, 2014

I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants