Skip to content

Commit

Permalink
liveness.rs: rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Aug 13, 2018
1 parent b894a62 commit 49b6773
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/librustc_mir/util/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,12 @@ pub fn liveness_of_locals<'tcx, V: Idx>(
) -> LivenessResult<V> {
let num_live_vars = map.num_variables();

let def_use: IndexVec<_, DefsUses<V>> = mir
.basic_blocks()
let def_use: IndexVec<_, DefsUses<V>> = mir.basic_blocks()
.iter()
.map(|b| block(mode, map, b, num_live_vars))
.collect();

let mut outs: IndexVec<_, LiveVarSet<V>> = mir
.basic_blocks()
let mut outs: IndexVec<_, LiveVarSet<V>> = mir.basic_blocks()
.indices()
.map(|_| LiveVarSet::new_empty(num_live_vars))
.collect();
Expand Down Expand Up @@ -427,7 +425,9 @@ where
if let Some(v_index) = self.map.from_local(local) {
match categorize(context) {
Some(DefUse::Def) => self.defs_uses.add_def(v_index),
Some(DefUse::Use) if self.mode.include_regular_use => self.defs_uses.add_use(v_index),
Some(DefUse::Use) if self.mode.include_regular_use => {
self.defs_uses.add_use(v_index)
}
Some(DefUse::Drop) if self.mode.include_drops => self.defs_uses.add_use(v_index),
_ => (),
}
Expand Down Expand Up @@ -518,7 +518,8 @@ pub fn write_mir_fn<'a, 'tcx, V: Idx>(
write_mir_intro(tcx, src, mir, w)?;
for block in mir.basic_blocks().indices() {
let print = |w: &mut dyn Write, prefix, result: &IndexVec<BasicBlock, LiveVarSet<V>>| {
let live: Vec<String> = result[block].iter()
let live: Vec<String> = result[block]
.iter()
.map(|v| map.from_live_var(v))
.map(|local| format!("{:?}", local))
.collect();
Expand Down

0 comments on commit 49b6773

Please sign in to comment.