File tree 4 files changed +14
-15
lines changed
4 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,15 @@ extern crate test;
8
8
use self :: miri:: eval_main;
9
9
use rustc:: hir:: def_id:: LOCAL_CRATE ;
10
10
use rustc_interface:: interface;
11
+ use rustc_driver:: Compilation ;
11
12
use crate :: test:: Bencher ;
12
13
13
14
struct MiriCompilerCalls < ' a > {
14
15
bencher : & ' a mut Bencher ,
15
16
}
16
17
17
18
impl rustc_driver:: Callbacks for MiriCompilerCalls < ' _ > {
18
- fn after_analysis ( & mut self , compiler : & interface:: Compiler ) -> bool {
19
+ fn after_analysis ( & mut self , compiler : & interface:: Compiler ) -> Compilation {
19
20
compiler. session ( ) . abort_if_errors ( ) ;
20
21
21
22
compiler. global_ctxt ( ) . unwrap ( ) . peek_mut ( ) . enter ( |tcx| {
@@ -31,8 +32,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls<'_> {
31
32
32
33
compiler. session ( ) . abort_if_errors ( ) ;
33
34
34
- // Don't continue execution
35
- false
35
+ Compilation :: Stop
36
36
}
37
37
}
38
38
Original file line number Diff line number Diff line change 1
- d36b7f69448f7390fa9dfde75d58b914365acdab
1
+ 527dce7137f7a3c7bf47d9a503abf25f88ea22de
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ use rustc_interface::interface;
19
19
use rustc:: hir:: { self , itemlikevisit} ;
20
20
use rustc:: ty:: TyCtxt ;
21
21
use rustc:: hir:: def_id:: LOCAL_CRATE ;
22
+ use rustc_driver:: Compilation ;
22
23
23
24
use miri:: MiriConfig ;
24
25
@@ -28,18 +29,17 @@ struct MiriCompilerCalls {
28
29
}
29
30
30
31
impl rustc_driver:: Callbacks for MiriCompilerCalls {
31
- fn after_parsing ( & mut self , compiler : & interface:: Compiler ) -> bool {
32
+ fn after_parsing ( & mut self , compiler : & interface:: Compiler ) -> Compilation {
32
33
let attr = (
33
34
syntax:: symbol:: Symbol :: intern ( "miri" ) ,
34
35
syntax:: feature_gate:: AttributeType :: Whitelisted ,
35
36
) ;
36
37
compiler. session ( ) . plugin_attributes . borrow_mut ( ) . push ( attr) ;
37
38
38
- // Continue execution
39
- true
39
+ Compilation :: Continue
40
40
}
41
41
42
- fn after_analysis ( & mut self , compiler : & interface:: Compiler ) -> bool {
42
+ fn after_analysis ( & mut self , compiler : & interface:: Compiler ) -> Compilation {
43
43
compiler. session ( ) . abort_if_errors ( ) ;
44
44
compiler. global_ctxt ( ) . unwrap ( ) . peek_mut ( ) . enter ( |tcx| {
45
45
if std:: env:: args ( ) . any ( |arg| arg == "--test" ) {
@@ -71,7 +71,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
71
71
} ) ;
72
72
73
73
// Continue execution on host target
74
- self . host_target
74
+ if self . host_target { Compilation :: Continue } else { Compilation :: Stop }
75
75
}
76
76
}
77
77
Original file line number Diff line number Diff line change @@ -21,24 +21,24 @@ use hex::FromHexError;
21
21
22
22
use rustc_interface:: interface;
23
23
use rustc:: hir:: def_id:: LOCAL_CRATE ;
24
+ use rustc_driver:: Compilation ;
24
25
25
26
struct MiriCompilerCalls {
26
27
miri_config : miri:: MiriConfig ,
27
28
}
28
29
29
30
impl rustc_driver:: Callbacks for MiriCompilerCalls {
30
- fn after_parsing ( & mut self , compiler : & interface:: Compiler ) -> bool {
31
+ fn after_parsing ( & mut self , compiler : & interface:: Compiler ) -> Compilation {
31
32
let attr = (
32
33
syntax:: symbol:: Symbol :: intern ( "miri" ) ,
33
34
syntax:: feature_gate:: AttributeType :: Whitelisted ,
34
35
) ;
35
36
compiler. session ( ) . plugin_attributes . borrow_mut ( ) . push ( attr) ;
36
37
37
- // Continue execution
38
- true
38
+ Compilation :: Continue
39
39
}
40
40
41
- fn after_analysis ( & mut self , compiler : & interface:: Compiler ) -> bool {
41
+ fn after_analysis ( & mut self , compiler : & interface:: Compiler ) -> Compilation {
42
42
init_late_loggers ( ) ;
43
43
compiler. session ( ) . abort_if_errors ( ) ;
44
44
@@ -54,8 +54,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
54
54
55
55
compiler. session ( ) . abort_if_errors ( ) ;
56
56
57
- // Don't continue execution
58
- false
57
+ Compilation :: Stop
59
58
}
60
59
}
61
60
You can’t perform that action at this time.
0 commit comments