-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Implicit return of last expression doesn't work #1194
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
Comments
|
The line in question was
Removing the
just works fine (no |
I think this is covered in the expression syntax section of the tutorial |
so it becomes nil. Well, a better error message or perhaps a warning would be nice in such cases. |
I think pcwalton proposed at some point a way to make the trailing semi optional. I've heard a few complaints about this syntax. A warning would definitely be useful. I'll open another issue for that. |
…tput directory ..." (rust-lang#1194)
…tput directory ..." (rust-lang#1194)
According to the tutorial,
fn foo()->int { 7 }
should be equivalent tofn foo()->int { ret 7; }
. However, rustc right now rejects such function definitions.The text was updated successfully, but these errors were encountered: