File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,9 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
6363 queries : & ' tcx rustc_interface:: Queries < ' tcx > ,
6464 ) -> Compilation {
6565 queries. global_ctxt ( ) . unwrap ( ) . enter ( |tcx| {
66- tcx. sess . abort_if_errors ( ) ;
66+ if tcx. sess . compile_status ( ) . is_err ( ) {
67+ tcx. sess . fatal ( "miri cannot be run on programs that fail compilation" ) ;
68+ }
6769
6870 init_late_loggers ( tcx) ;
6971 if !tcx. sess . crate_types ( ) . contains ( & CrateType :: Executable ) {
Original file line number Diff line number Diff line change 1+ //@error-pattern: miri cannot be run on programs that fail compilation
2+
3+ #![ deny( warnings) ]
4+
5+ struct Foo ;
6+ //~^ ERROR: struct `Foo` is never constructed
7+
8+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error: struct `Foo` is never constructed
2+ --> $DIR/deny_lint.rs:LL:CC
3+ |
4+ LL | struct Foo;
5+ | ^^^
6+ |
7+ = note: `-D dead-code` implied by `-D unused`
8+
9+ error: miri cannot be run on programs that fail compilation
10+
11+ error: aborting due to 2 previous errors
12+
You can’t perform that action at this time.
0 commit comments