Rollup merge of #61248 - spastorino:use-place-local-fn, r=oli-obk

Use Place::local

r? @oli-obk
This commit is contained in:
Mazdak Farrokhzad 2019-05-28 11:49:09 +02:00 committed by GitHub
commit 149c53fc44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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