Skip to content

Commit

Permalink
Rollup merge of rust-lang#61248 - spastorino:use-place-local-fn, r=ol…
Browse files Browse the repository at this point in the history
…i-obk

Use Place::local

r? @oli-obk
  • Loading branch information
Centril committed May 28, 2019
2 parents 1dc9bbb + 38ecea4 commit 149c53f
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 149c53f

Please sign in to comment.