Skip to content

Part of "Closures" section of book could be clearer #26268

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

Closed
ghost opened this issue Jun 13, 2015 · 0 comments
Closed

Part of "Closures" section of book could be clearer #26268

ghost opened this issue Jun 13, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 13, 2015

https://doc.rust-lang.org/book/closures.html#closures-and-their-environment

Right before the "move closures" section, the book doesn't really make it clear that this code would not compile:

let nums = vec![1, 2, 3];

let takes_nums = || nums;

println!("{:?}", nums);

It shows part of the compile error, but it just looks like a non-error message from the compiler.

Consider appending "the error message" to "This gives us".

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