Function rustc_typeck::check::upvar::restrict_precision_for_box [−][src]
fn restrict_precision_for_box<'tcx>(
capture_clause: CaptureBy,
place: Place<'tcx>
) -> Place<'tcx>
Expand description
Deref of a box isn’t captured in move clousres. This is motivated by:
- We only want to capture data that is on the stack
- One motivation for the user to use a box might be to reduce the amount of data that gets moved (if size of pointer < size of data). We want to make sure that this optimization that the user made is respected.