Clarify that the following will error

Fixes #26268
This commit is contained in:
Steve Klabnik 2015-06-15 13:18:07 -04:00
parent 0d82fb55db
commit 1792ef6ae4

View File

@ -120,7 +120,7 @@ let y = &mut num;
```
If your closure requires it, however, Rust will take ownership and move
the environment instead:
the environment instead. This doesnt work:
```rust,ignore
let nums = vec![1, 2, 3];
@ -130,7 +130,7 @@ let takes_nums = || nums;
println!("{:?}", nums);
```
This gives us:
We get this error:
```text
note: `nums` moved into closure environment here because it has type