Use Place::local
This commit is contained in:
parent
4dbc7f96d6
commit
38ecea4c11
1 changed files with 3 additions and 7 deletions
|
@ -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"
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue