1
Fork 0

Closures implement Copy and Clone, generators don't

This commit is contained in:
Jake Goulding 2019-06-19 23:03:33 -04:00 committed by GitHub
parent 7d10761349
commit b0dd7fc9f5
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