diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-02-17 23:51:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-17 23:51:19 +0100 |
| commit | 0b2f2b941332954c5bd80e61eabce3ee2161a7f5 (patch) | |
| tree | 589fbb4f268b617baf3e4ca1099ad7d5fda1c98a /library/std/src/sys/unix/stack_overflow.rs | |
| parent | cdd93fd3e2f6fb03717db137196a371f6b5c55f7 (diff) | |
| parent | f99e152e5a02d75e5df1a10b33d4e8592cd25fee (diff) | |
| download | rust-0b2f2b941332954c5bd80e61eabce3ee2161a7f5.tar.gz rust-0b2f2b941332954c5bd80e61eabce3ee2161a7f5.zip | |
Rollup merge of #82007 - sexxi-goose:reborrow, r=nikomatsakis
Implement reborrow for closure captures The strategy for captures is detailed here with examples: https://hackmd.io/PzxYMPY4RF-B9iH9uj9GTA Key points: - We only need to reborrow a capture in case of move closures. - If we mutate something via a `&mut` we store it as a `MutBorrow`/`UniqueMuBorrow` of the path containing the `&mut`, - Similarly, if it's read via `&` ref we just store it as a `ImmBorrow` of the path containing the `&` ref. - If a path doesn't deref a `&mut`, `&`, then that path is captured by Move. - If the use of a path results in a move when the closure is called, then that path is truncated before any deref and the truncated path is moved into the closure. - In the case of non-move closure if a use of a path results in a move, then the path is truncated before any deref and the truncated path is moved into the closure. Note that the implementation differs a bit from the document to allow for truncated path to be used in the ClosureKind analysis that happens as part of the first capture analysis pass. Closes: https://github.com/rust-lang/project-rfc-2229/issues/31 r? ````@nikomatsakis````
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
