Skip to content

Commit 0a6a5c8

Browse files
committed
Move debug statement into statement visitor
1 parent a39fffe commit 0a6a5c8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/librustc_mir/borrow_check/used_muts.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ impl GatherUsedMutsVisitor<'_, '_, '_, '_> {
6060
// they will either have been removed by unreachable code optimizations; or linted
6161
// as unused variables.
6262
if let Some(local) = into.base_local() {
63-
debug!(
64-
"visit_statement: statement={:?} local={:?} \
65-
never_initialized_mut_locals={:?}",
66-
statement, local, self.never_initialized_mut_locals
67-
);
6863
let _ = self.never_initialized_mut_locals.remove(&local);
6964
}
7065
}
@@ -95,6 +90,13 @@ impl<'visit, 'cx, 'gcx, 'tcx> Visitor<'tcx> for GatherUsedMutsVisitor<'visit, 'c
9590
) {
9691
match &statement.kind {
9792
StatementKind::Assign(into, _) => {
93+
if let Some(local) = into.base_local() {
94+
debug!(
95+
"visit_statement: statement={:?} local={:?} \
96+
never_initialized_mut_locals={:?}",
97+
statement, local, self.never_initialized_mut_locals
98+
);
99+
}
98100
self.remove_never_initialized_mut_locals(into);
99101
},
100102
_ => {},

0 commit comments

Comments
 (0)