rust/compiler/rustc_mir
Jonas Schievink 7e3a8ec688
Rollup merge of #80092 - sexxi-goose:restrict_precision, r=nikomatsakis
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`````
2021-01-31 16:36:41 +01:00
..
src Rollup merge of #80092 - sexxi-goose:restrict_precision, r=nikomatsakis 2021-01-31 16:36:41 +01:00
Cargo.toml Auto merge of #78399 - vn-ki:gsgdt-graphviz, r=oli-obk 2020-12-15 22:00:02 +00:00