Rollup merge of #61981 - rust-lang:generators-clone-doc, r=cramertj

Closures implement Copy and Clone, generators don't
This commit is contained in:
Mazdak Farrokhzad 2019-06-20 22:14:26 +02:00 committed by GitHub
commit fdbc4ce686
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -146,7 +146,7 @@ closure-like semantics. Namely:
generators also depend on variables live across suspension points. This means
that although the ambient environment may be `Send` or `Sync`, the generator
itself may not be due to internal variables live across `yield` points being
not-`Send` or not-`Sync`. Note that generators, like closures, do
not-`Send` or not-`Sync`. Note that generators do
not implement traits like `Copy` or `Clone` automatically.
* Whenever a generator is dropped it will drop all captured environment