Skip to content

Commit e745cf1

Browse files
committed
Auto merge of #51399 - ngg:nll-performance, r=nikomatsakis
NLL performance boost This makes compilation of the [inflate](https://github.com/rust-lang-nursery/rustc-perf/tree/master/collector/benchmarks/inflate) benchmark compile 2 times faster on my computer when NLL is enabled. This does not fix the #51377 perfectly, it's still 4-5 times slower than without NLL, but it's a start.
2 parents c131bdc + f1c9247 commit e745cf1

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)