Skip to content

Commit f1c9247

Browse files
committed
NLL performance boost
1 parent 4a9c58c commit f1c9247

File tree

1 file changed

+9
-7
lines changed
  • src/librustc_mir/borrow_check/nll/type_check

1 file changed

+9
-7
lines changed

src/librustc_mir/borrow_check/nll/type_check/liveness.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,15 @@ impl<'gen, 'typeck, 'flow, 'gcx, 'tcx> TypeLivenessGenerator<'gen, 'typeck, 'flo
104104
location, live_local
105105
);
106106

107-
self.flow_inits.each_state_bit(|mpi_init| {
108-
debug!(
109-
"add_liveness_constraints: location={:?} initialized={:?}",
110-
location,
111-
&self.flow_inits.operator().move_data().move_paths[mpi_init]
112-
);
113-
});
107+
if log_enabled!(::log::Level::Debug) {
108+
self.flow_inits.each_state_bit(|mpi_init| {
109+
debug!(
110+
"add_liveness_constraints: location={:?} initialized={:?}",
111+
location,
112+
&self.flow_inits.operator().move_data().move_paths[mpi_init]
113+
);
114+
});
115+
}
114116

115117
let mpi = self.move_data.rev_lookup.find_local(live_local);
116118
if let Some(initialized_child) = self.flow_inits.has_any_child_of(mpi) {

0 commit comments

Comments
 (0)