@@ -6,23 +6,26 @@ extern crate rustc_interface;
6
6
extern crate test;
7
7
8
8
use self :: miri:: eval_main;
9
+ use crate :: test:: Bencher ;
9
10
use rustc:: hir:: def_id:: LOCAL_CRATE ;
10
- use rustc_interface:: { interface, Queries } ;
11
11
use rustc_driver:: Compilation ;
12
- use crate :: test :: Bencher ;
12
+ use rustc_interface :: { interface , Queries } ;
13
13
14
14
struct MiriCompilerCalls < ' a > {
15
15
bencher : & ' a mut Bencher ,
16
16
}
17
17
18
18
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 {
20
24
compiler. session ( ) . abort_if_errors ( ) ;
21
25
22
26
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" ) ;
26
29
27
30
self . bencher . iter ( || {
28
31
let config = miri:: MiriConfig {
@@ -50,13 +53,9 @@ fn find_sysroot() -> String {
50
53
let toolchain = option_env ! ( "RUSTUP_TOOLCHAIN" ) . or ( option_env ! ( "MULTIRUST_TOOLCHAIN" ) ) ;
51
54
match ( home, toolchain) {
52
55
( 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 ( ) ,
60
59
}
61
60
}
62
61
0 commit comments