Skip to content

Commit da018dc

Browse files
committed
Rollup merge of rust-lang#32679 - tclfs:patch-1, r=steveklabnik
Remove error description of `move` (1) `x` can be used in main() after the call to spawn(). Because the variables follow normal move semantics, though the keyword `move` is used, and i32 implements `Copy`. (2) I remove this sentence because the previous sentence gives the referrence to `move closures`, and more description of `move` may be redundant.
2 parents 1bf836e + a2f6d29 commit da018dc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/doc/book/concurrency.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ thread may outlive the scope of `x`, leading to a dangling pointer.
127127

128128
To fix this, we use a `move` closure as mentioned in the error message. `move`
129129
closures are explained in depth [here](closures.html#move-closures); basically
130-
they move variables from their environment into themselves. This means that `x`
131-
is now owned by the closure, and cannot be used in `main()` after the call to
132-
`spawn()`.
130+
they move variables from their environment into themselves.
133131

134132
```rust
135133
use std::thread;

0 commit comments

Comments
 (0)