Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2a24e97

Browse files
committedApr 18, 2015
Return nonzero exit code if there are errors at a stop point
1 parent 7a5754b commit 2a24e97

File tree

215 files changed

+440
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+440
-6
lines changed
 

‎src/librustc_driver/driver.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ pub fn compile_input(sess: Session,
5252
output: &Option<PathBuf>,
5353
addl_plugins: Option<Vec<String>>,
5454
control: CompileController) {
55-
macro_rules! controller_entry_point{($point: ident, $make_state: expr) => ({
56-
{
57-
let state = $make_state;
58-
(control.$point.callback)(state);
59-
}
55+
macro_rules! controller_entry_point{($point: ident, $tsess: expr, $make_state: expr) => ({
56+
let state = $make_state;
57+
(control.$point.callback)(state);
58+
59+
$tsess.abort_if_errors();
6060
if control.$point.stop == Compilation::Stop {
6161
return;
6262
}
@@ -70,6 +70,7 @@ pub fn compile_input(sess: Session,
7070
let krate = phase_1_parse_input(&sess, cfg, input);
7171

7272
controller_entry_point!(after_parse,
73+
sess,
7374
CompileState::state_after_parse(input,
7475
&sess,
7576
outdir,
@@ -96,6 +97,7 @@ pub fn compile_input(sess: Session,
9697
};
9798

9899
controller_entry_point!(after_expand,
100+
sess,
99101
CompileState::state_after_expand(input,
100102
&sess,
101103
outdir,
@@ -109,6 +111,7 @@ pub fn compile_input(sess: Session,
109111
write_out_deps(&sess, input, &outputs, &id[..]);
110112

111113
controller_entry_point!(after_write_deps,
114+
sess,
112115
CompileState::state_after_write_deps(input,
113116
&sess,
114117
outdir,
@@ -123,6 +126,7 @@ pub fn compile_input(sess: Session,
123126
control.make_glob_map);
124127

125128
controller_entry_point!(after_analysis,
129+
analysis.ty_cx.sess,
126130
CompileState::state_after_analysis(input,
127131
&analysis.ty_cx.sess,
128132
outdir,
@@ -149,6 +153,7 @@ pub fn compile_input(sess: Session,
149153
phase_5_run_llvm_passes(&sess, &trans, &outputs);
150154

151155
controller_entry_point!(after_llvm,
156+
sess,
152157
CompileState::state_after_llvm(input,
153158
&sess,
154159
outdir,

‎src/test/compile-fail/mod_file_disambig.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-flags: -Z parse-only
12+
1113
mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` found at both
1214

1315
fn main() {

0 commit comments

Comments
 (0)
Please sign in to comment.