1
Fork 0

Handle restricting closure origin

This commit is contained in:
Aman Arora 2021-02-08 23:31:26 -05:00
parent b86c5db96e
commit e39c3c05a4
3 changed files with 40 additions and 4 deletions

View file

@ -206,11 +206,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// If we have an origin, store it.
if let Some(origin) = delegate.current_origin.clone() {
let origin = if self.tcx.features().capture_disjoint_fields {
origin
(origin.0, restrict_capture_precision(origin.1))
} else {
// FIXME(project-rfc-2229#31): Once the changes to support reborrowing are
// made, make sure we are selecting and restricting
// the origin correctly.
(origin.0, Place { projections: vec![], ..origin.1 })
};