rust/compiler/rustc_mir_build/src
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
..
build Rollup merge of #80092 - sexxi-goose:restrict_precision, r=nikomatsakis 2021-01-31 16:36:41 +01:00
thir Rollup merge of #79951 - LeSeulArtichaut:ty-ir, r=nikomatsakis 2021-01-28 15:09:02 +09:00
lib.rs Cache head constructor in PatStack 2020-10-27 00:46:32 +00:00
lints.rs Don't re-export std::ops::ControlFlow in the compiler. 2020-10-22 17:26:55 -07:00