Skip to content

Commit 38ecea4

Browse files
committed
Use Place::local
1 parent 4dbc7f9 commit 38ecea4

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/librustc_mir/build/expr/as_rvalue.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -528,13 +528,9 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
528528
}) => {
529529
// Not projected from the implicit `self` in a closure.
530530
debug_assert!(
531-
match *base {
532-
Place::Base(PlaceBase::Local(local)) => local == Local::new(1),
533-
Place::Projection(box Projection {
534-
ref base,
535-
elem: ProjectionElem::Deref,
536-
}) => *base == Place::Base(PlaceBase::Local(Local::new(1))),
537-
_ => false,
531+
match base.local() {
532+
Some(local) => local == Local::new(1),
533+
None => false,
538534
},
539535
"Unexpected capture place"
540536
);

0 commit comments

Comments
 (0)