Skip to content

Commit

Permalink
Use Place::local
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed May 27, 2019
1 parent 4dbc7f9 commit 38ecea4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/librustc_mir/build/expr/as_rvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
Expand Down

0 comments on commit 38ecea4

Please sign in to comment.