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

Cannot elide lifetime parameters in function return types #16731

Closed
mbrubeck opened this issue Aug 24, 2014 · 1 comment
Closed

Cannot elide lifetime parameters in function return types #16731

mbrubeck opened this issue Aug 24, 2014 · 1 comment

Comments

@mbrubeck
Copy link
Contributor

According to RFC 39: Lifetime Elision this should be legal:

struct S<'a>;
fn f() -> S { S }

but it fails to compile with:

lifetime-elision.rs:3:11: 3:12 error: wrong number of lifetime parameters: expected 1 but found 0 [E0107]
lifetime-elision.rs:3 fn f() -> S {
                                ^

This is part of #15552, so I think it should be nominated for 1.0 blocking.

@mbrubeck
Copy link
Contributor Author

Oops, my bad. I misunderstood the RFC. My test case above does require a lifetime annotation because f has no arguments. The original code it was reduced from required one because it had multiple reference arguments. Closing this issue as invalid.

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

1 participant