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

[guide] variable binding outside a function #19199

Closed
evangoer opened this issue Nov 21, 2014 · 1 comment · Fixed by #19307
Closed

[guide] variable binding outside a function #19199

evangoer opened this issue Nov 21, 2014 · 1 comment · Fixed by #19307

Comments

@evangoer
Copy link

If the reader starts section 4 and tries to play around with variables by doing a bare let x = 5i;, they'll run into the error:

variables.rs:1:1: 1:4 error: expected item, found `let`

The guide should update the first few examples in section 4 to explicitly show let declared inside a function, so that the code will compile. This would also be a good place to explain why declaring the let outside fn yields an error.

@evangoer
Copy link
Author

Well done, thank you all! :)

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

Successfully merging a pull request may close this issue.

2 participants