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

Commit 32a7618

Browse files
committed
Use Place directly on remove_never_initialized_mut_locals, it's Copy
1 parent a67b28a commit 32a7618

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc_mir/borrow_check/used_muts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct GatherUsedMutsVisitor<'visit, 'cx, 'tcx> {
5151
}
5252

5353
impl GatherUsedMutsVisitor<'_, '_, '_> {
54-
fn remove_never_initialized_mut_locals(&mut self, into: &Place<'_>) {
54+
fn remove_never_initialized_mut_locals(&mut self, into: Place<'_>) {
5555
// Remove any locals that we found were initialized from the
5656
// `never_initialized_mut_locals` set. At the end, the only remaining locals will
5757
// be those that were never initialized - we will consider those as being used as
@@ -66,10 +66,10 @@ impl<'visit, 'cx, 'tcx> Visitor<'tcx> for GatherUsedMutsVisitor<'visit, 'cx, 'tc
6666
debug!("visit_terminator_kind: kind={:?}", kind);
6767
match &kind {
6868
TerminatorKind::Call { destination: Some((into, _)), .. } => {
69-
self.remove_never_initialized_mut_locals(&into);
69+
self.remove_never_initialized_mut_locals(*into);
7070
}
7171
TerminatorKind::DropAndReplace { location, .. } => {
72-
self.remove_never_initialized_mut_locals(&location);
72+
self.remove_never_initialized_mut_locals(*location);
7373
}
7474
_ => {}
7575
}
@@ -82,7 +82,7 @@ impl<'visit, 'cx, 'tcx> Visitor<'tcx> for GatherUsedMutsVisitor<'visit, 'cx, 'tc
8282
never_initialized_mut_locals={:?}",
8383
statement, into.local, self.never_initialized_mut_locals
8484
);
85-
self.remove_never_initialized_mut_locals(into);
85+
self.remove_never_initialized_mut_locals(*into);
8686
}
8787
}
8888

0 commit comments

Comments
 (0)