mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
7e3a8ec688
2229: Fix issues with move closures and mutability This PR fixes two issues when feature `capture_disjoint_fields` is used. 1. Can't mutate using a mutable reference 2. Move closures try to move value out through a reference. To do so, we 1. Compute the mutability of the capture and store it as part of the `CapturedPlace` that is written in TypeckResults 2. Restrict capture precision. Note this is temporary for now, to allow the feature to be used with move closures and ByValue captures and might change depending on discussions with the lang team. - No Derefs are captured for ByValue captures, since that will result in value behind a reference getting moved. - No projections are applied to raw pointers since these require unsafe blocks. We capture them completely. r? `````@nikomatsakis````` |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |