diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-05-28 11:49:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-28 11:49:09 +0200 |
| commit | 149c53fc442a690ea6a5c309f408cb2160039b9b (patch) | |
| tree | 6afa790e230d5ecc9d3ee1849652e00c74688137 | |
| parent | 1dc9bbbffe166f46845912e45f759f20b284a9f8 (diff) | |
| parent | 38ecea4c115114c0e8a19d90d1ca8b5af8f5cf85 (diff) | |
| download | rust-149c53fc442a690ea6a5c309f408cb2160039b9b.tar.gz rust-149c53fc442a690ea6a5c309f408cb2160039b9b.zip | |
Rollup merge of #61248 - spastorino:use-place-local-fn, r=oli-obk
Use Place::local r? @oli-obk
| -rw-r--r-- | src/librustc_mir/build/expr/as_rvalue.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/librustc_mir/build/expr/as_rvalue.rs b/src/librustc_mir/build/expr/as_rvalue.rs index a0b504a99de..07a9f294fb6 100644 --- a/src/librustc_mir/build/expr/as_rvalue.rs +++ b/src/librustc_mir/build/expr/as_rvalue.rs @@ -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" ); |
