@@ -6,23 +6,26 @@ extern crate rustc_interface;
66extern crate test;
77
88use self :: miri:: eval_main;
9+ use crate :: test:: Bencher ;
910use rustc:: hir:: def_id:: LOCAL_CRATE ;
10- use rustc_interface:: { interface, Queries } ;
1111use rustc_driver:: Compilation ;
12- use crate :: test :: Bencher ;
12+ use rustc_interface :: { interface , Queries } ;
1313
1414struct MiriCompilerCalls < ' a > {
1515 bencher : & ' a mut Bencher ,
1616}
1717
1818impl 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
0 commit comments