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

Parentheses notation should respect lifetime elision #18992

Closed
nikomatsakis opened this issue Nov 16, 2014 · 3 comments · Fixed by #19589
Closed

Parentheses notation should respect lifetime elision #18992

nikomatsakis opened this issue Nov 16, 2014 · 3 comments · Fixed by #19589
Labels
P-medium Medium priority

Comments

@nikomatsakis
Copy link
Contributor

HRTB doesn't correctly implement lifetime elision for Fn() notation. See the test src/test/compile-fail/unboxed-closure-sugar-equiv.rs.

@nikomatsakis
Copy link
Contributor Author

Nominating.

@pnkfelix
Copy link
Member

@alexcrichton notes that this can be fixed backwards compatibly, and @nikomatsakis agrees.

P-high, not 1.0.

@pnkfelix pnkfelix added P-medium Medium priority and removed I-nominated labels Nov 20, 2014
@nikomatsakis
Copy link
Contributor Author

Well, sort of -- I mean lifetime elision broke code, but almost only bad code. The problem is that people can use transmute to satisfy the signature and then clients get to assume any lifetime they want.

huonw added a commit to huonw/rust that referenced this issue Dec 6, 2014
This means that `Fn(&A) -> (&B, &C)` is equivalent to `for<'a> Fn(&'a A)
-> (&'a B, &'a C)` similar to the lifetime elision of lower-case `fn` in
types and declarations.

Closes rust-lang#18992.
alexcrichton added a commit to alexcrichton/rust that referenced this issue Dec 9, 2014
This means that `Fn(&A) -> (&B, &C)` is equivalent to `for<'a> Fn(&'a A)
-> (&'a B, &'a C)` similar to the lifetime elision of lower-case `fn` in
types and declarations.

Closes rust-lang#18992.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-medium Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants