Skip to content

Commit 20e843f

Browse files
committed
Auto merge of #1118 - rust-lang:stacked_borrow_tracing, r=oli-obk
Run rustfmt This is `cargo +nightly fmt --all` with `rustc 1.41.0-nightly (c8ea4ace9 2019-12-14)`
2 parents a3ea1cb + 7ead530 commit 20e843f

25 files changed

+901
-894
lines changed

benches/fibonacci.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::helpers::*;
77

88
#[bench]
99
fn fib(bencher: &mut Bencher) {
10-
bencher.iter(|| { fibonacci_helper::main(); })
10+
bencher.iter(|| fibonacci_helper::main())
1111
}
1212

1313
#[bench]
@@ -17,7 +17,7 @@ fn fib_miri(bencher: &mut Bencher) {
1717

1818
#[bench]
1919
fn fib_iter(bencher: &mut Bencher) {
20-
bencher.iter(|| { fibonacci_helper_iterative::main(); })
20+
bencher.iter(|| fibonacci_helper_iterative::main())
2121
}
2222

2323
#[bench]

benches/helpers/miri_helper.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,26 @@ extern crate rustc_interface;
66
extern crate test;
77

88
use self::miri::eval_main;
9+
use crate::test::Bencher;
910
use rustc::hir::def_id::LOCAL_CRATE;
10-
use rustc_interface::{interface, Queries};
1111
use rustc_driver::Compilation;
12-
use crate::test::Bencher;
12+
use rustc_interface::{interface, Queries};
1313

1414
struct MiriCompilerCalls<'a> {
1515
bencher: &'a mut Bencher,
1616
}
1717

1818
impl rustc_driver::Callbacks for MiriCompilerCalls<'_> {
19-
fn after_analysis<'tcx>(&mut self, compiler: &interface::Compiler, queries: &'tcx Queries<'tcx>) -> Compilation {
19+
fn after_analysis<'tcx>(
20+
&mut self,
21+
compiler: &interface::Compiler,
22+
queries: &'tcx Queries<'tcx>,
23+
) -> Compilation {
2024
compiler.session().abort_if_errors();
2125

2226
queries.global_ctxt().unwrap().peek_mut().enter(|tcx| {
23-
let (entry_def_id, _) = tcx.entry_fn(LOCAL_CRATE).expect(
24-
"no main or start function found",
25-
);
27+
let (entry_def_id, _) =
28+
tcx.entry_fn(LOCAL_CRATE).expect("no main or start function found");
2629

2730
self.bencher.iter(|| {
2831
let config = miri::MiriConfig {
@@ -50,13 +53,9 @@ fn find_sysroot() -> String {
5053
let toolchain = option_env!("RUSTUP_TOOLCHAIN").or(option_env!("MULTIRUST_TOOLCHAIN"));
5154
match (home, toolchain) {
5255
(Some(home), Some(toolchain)) => format!("{}/toolchains/{}", home, toolchain),
53-
_ => {
54-
option_env!("RUST_SYSROOT")
55-
.expect(
56-
"need to specify RUST_SYSROOT env var or use rustup or multirust",
57-
)
58-
.to_owned()
59-
}
56+
_ => option_env!("RUST_SYSROOT")
57+
.expect("need to specify RUST_SYSROOT env var or use rustup or multirust")
58+
.to_owned(),
6059
}
6160
}
6261

benches/smoke.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::helpers::*;
77

88
#[bench]
99
fn noop(bencher: &mut Bencher) {
10-
bencher.iter(|| { smoke_helper::main(); })
10+
bencher.iter(|| smoke_helper::main())
1111
}
1212

1313
/*

rustfmt.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
use_small_heuristics = "Max"
2+
version = "Two"
3+
match_arm_blocks = false

0 commit comments

Comments
 (0)