Skip to content

Commit

Permalink
libtest: remove redundant argument to writeln!() (clippy::writeln_emp…
Browse files Browse the repository at this point in the history
…ty_string)
  • Loading branch information
matthiaskrgr committed Mar 7, 2020
1 parent 77af19e commit f326f0f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/librustc_mir/util/liveness.rs
Expand Up @@ -293,7 +293,7 @@ fn dump_matched_mir_node<'tcx>(
writeln!(file, "// MIR local liveness analysis for `{}`", node_path)?;
writeln!(file, "// source = {:?}", source)?;
writeln!(file, "// pass_name = {}", pass_name)?;
writeln!(file, "")?;
writeln!(file)?;
write_mir_fn(tcx, source, body, &mut file, result)?;
Ok(())
});
Expand All @@ -316,7 +316,7 @@ pub fn write_mir_fn<'tcx>(
write_basic_block(tcx, block, body, &mut |_, _| Ok(()), w)?;
print(w, " ", &result.outs)?;
if block.index() + 1 != body.basic_blocks().len() {
writeln!(w, "")?;
writeln!(w)?;
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/librustc_mir/util/pretty.rs
Expand Up @@ -134,7 +134,7 @@ fn dump_matched_mir_node<'tcx, F>(
if let Some(ref layout) = body.generator_layout {
writeln!(file, "// generator_layout = {:?}", layout)?;
}
writeln!(file, "")?;
writeln!(file)?;
extra_data(PassWhere::BeforeCFG, &mut file)?;
write_user_type_annotations(body, &mut file)?;
write_mir_fn(tcx, source, body, &mut extra_data, &mut file)?;
Expand Down Expand Up @@ -242,13 +242,13 @@ pub fn write_mir_pretty<'tcx>(
first = false;
} else {
// Put empty lines between all items
writeln!(w, "")?;
writeln!(w)?;
}

write_mir_fn(tcx, MirSource::item(def_id), body, &mut |_, _| Ok(()), w)?;

for (i, body) in tcx.promoted_mir(def_id).iter_enumerated() {
writeln!(w, "")?;
writeln!(w)?;
let src = MirSource { instance: ty::InstanceDef::Item(def_id), promoted: Some(i) };
write_mir_fn(tcx, src, body, &mut |_, _| Ok(()), w)?;
}
Expand All @@ -271,7 +271,7 @@ where
extra_data(PassWhere::BeforeBlock(block), w)?;
write_basic_block(tcx, block, body, extra_data, w)?;
if block.index() + 1 != body.basic_blocks().len() {
writeln!(w, "")?;
writeln!(w)?;
}
}

Expand Down Expand Up @@ -529,7 +529,7 @@ pub fn write_mir_intro<'tcx>(
write_scope_tree(tcx, body, &scope_tree, w, OUTERMOST_SOURCE_SCOPE, 1)?;

// Add an empty line before the first block is printed.
writeln!(w, "")?;
writeln!(w)?;

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion src/libtest/console.rs
Expand Up @@ -169,7 +169,7 @@ pub fn list_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn>) -> io::Res

if !quiet {
if ntest != 0 || nbench != 0 {
writeln!(output, "")?;
writeln!(output)?;
}

writeln!(output, "{}, {}", plural(ntest, "test"), plural(nbench, "benchmark"))?;
Expand Down

0 comments on commit f326f0f

Please sign in to comment.