Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit f026441

Browse files
committed
Use Place directly on propagate_closure_used_mut_place, it's Copy
1 parent d45dca3 commit f026441

File tree

1 file changed

+3
-4
lines changed
  • src/librustc_mir/borrow_check

1 file changed

+3
-4
lines changed

src/librustc_mir/borrow_check/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
12821282
}
12831283

12841284
fn propagate_closure_used_mut_upvar(&mut self, operand: &Operand<'tcx>) {
1285-
let propagate_closure_used_mut_place = |this: &mut Self, place: &Place<'tcx>| {
1285+
let propagate_closure_used_mut_place = |this: &mut Self, place: Place<'tcx>| {
12861286
if !place.projection.is_empty() {
12871287
if let Some(field) = this.is_upvar_field_projection(place.as_ref()) {
12881288
this.used_mut_upvars.push(field);
@@ -1296,7 +1296,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
12961296
// captures of a closure are copied/moved directly
12971297
// when generating MIR.
12981298
match *operand {
1299-
Operand::Move(ref place) | Operand::Copy(ref place) => {
1299+
Operand::Move(place) | Operand::Copy(place) => {
13001300
match place.as_local() {
13011301
Some(local) if !self.body.local_decls[local].is_user_variable() => {
13021302
if self.body.local_decls[local].ty.is_mutable_ptr() {
@@ -1335,8 +1335,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
13351335
let stmt = &bbd.statements[loc.statement_index];
13361336
debug!("temporary assigned in: stmt={:?}", stmt);
13371337

1338-
if let StatementKind::Assign(box (_, Rvalue::Ref(_, _, ref source))) =
1339-
stmt.kind
1338+
if let StatementKind::Assign(box (_, Rvalue::Ref(_, _, source))) = stmt.kind
13401339
{
13411340
propagate_closure_used_mut_place(self, source);
13421341
} else {

0 commit comments

Comments
 (0)