1
Fork 0

Use Place::local

This commit is contained in:
Santiago Pastorino 2019-05-27 23:03:38 +02:00
parent 4dbc7f96d6
commit 38ecea4c11

View file

@ -528,13 +528,9 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
}) => { }) => {
// Not projected from the implicit `self` in a closure. // Not projected from the implicit `self` in a closure.
debug_assert!( debug_assert!(
match *base { match base.local() {
Place::Base(PlaceBase::Local(local)) => local == Local::new(1), Some(local) => local == Local::new(1),
Place::Projection(box Projection { None => false,
ref base,
elem: ProjectionElem::Deref,
}) => *base == Place::Base(PlaceBase::Local(Local::new(1))),
_ => false,
}, },
"Unexpected capture place" "Unexpected capture place"
); );