diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2016-01-21 12:16:59 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2016-01-22 08:19:27 +1300 |
| commit | f3b525fb97c48976c740da50a38ec8c9e5f29b7e (patch) | |
| tree | e64979e86caeca78330305fec3c5a628cd799045 | |
| parent | 585cf6fb5f0c2736c781b6efb4651ba6d317a753 (diff) | |
| download | rust-f3b525fb97c48976c740da50a38ec8c9e5f29b7e.tar.gz rust-f3b525fb97c48976c740da50a38ec8c9e5f29b7e.zip | |
test fallout
| -rw-r--r-- | src/librustc_driver/driver.rs | 33 | ||||
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 13 | ||||
| -rw-r--r-- | src/test/compile-fail/cfg-non-opt-expr.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/double-type-import.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/import-from-missing.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/import.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/import2.rs | 3 | ||||
| -rw-r--r-- | src/test/compile-fail/macro-reexport-malformed-1.rs | 3 | ||||
| -rw-r--r-- | src/test/compile-fail/macro-reexport-malformed-2.rs | 3 | ||||
| -rw-r--r-- | src/test/compile-fail/macro-reexport-malformed-3.rs | 3 | ||||
| -rw-r--r-- | src/test/compile-fail/macro-reexport-undef.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/macro-use-bad-args-1.rs | 5 | ||||
| -rw-r--r-- | src/test/compile-fail/macro-use-bad-args-2.rs | 5 | ||||
| -rw-r--r-- | src/test/compile-fail/privacy3.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/self_type_keyword.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/use-mod.rs | 1 |
16 files changed, 46 insertions, 34 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 1db04033f94..36074a7ae02 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -70,6 +70,7 @@ pub fn compile_input(sess: Session, (control.$point.callback)(state); if control.$point.stop == Compilation::Stop { + $tsess.abort_if_errors(); return; } })} @@ -469,7 +470,11 @@ pub fn phase_2_configure_and_expand(sess: &Session, let mut feature_gated_cfgs = vec![]; krate = time(time_passes, "configuration 1", || { - syntax::config::strip_unconfigured_items(sess.diagnostic(), krate, &mut feature_gated_cfgs) + sess.abort_if_new_errors(|| { + syntax::config::strip_unconfigured_items(sess.diagnostic(), + krate, + &mut feature_gated_cfgs) + }) }); *sess.crate_types.borrow_mut() = collect_crate_types(sess, &krate.attrs); @@ -605,17 +610,23 @@ pub fn phase_2_configure_and_expand(sess: &Session, // JBC: make CFG processing part of expansion to avoid this problem: // strip again, in case expansion added anything with a #[cfg]. - krate = time(time_passes, "configuration 2", || { - syntax::config::strip_unconfigured_items(sess.diagnostic(), krate, &mut feature_gated_cfgs) - }); + krate = sess.abort_if_new_errors(|| { + let krate = time(time_passes, "configuration 2", || { + syntax::config::strip_unconfigured_items(sess.diagnostic(), + krate, + &mut feature_gated_cfgs) + }); - time(time_passes, "gated configuration checking", || { - let features = sess.features.borrow(); - feature_gated_cfgs.sort(); - feature_gated_cfgs.dedup(); - for cfg in &feature_gated_cfgs { - cfg.check_and_emit(sess.diagnostic(), &features, sess.codemap()); - } + time(time_passes, "gated configuration checking", || { + let features = sess.features.borrow(); + feature_gated_cfgs.sort(); + feature_gated_cfgs.dedup(); + for cfg in &feature_gated_cfgs { + cfg.check_and_emit(sess.diagnostic(), &features, sess.codemap()); + } + }); + + krate }); krate = time(time_passes, "maybe building test harness", || { diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 922ebb3683e..a8697f45d91 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -4229,7 +4229,9 @@ pub fn check_enum_variants<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, } // Check for unrepresentable discriminant values match hint { - attr::ReprAny | attr::ReprExtern => (), + attr::ReprAny | attr::ReprExtern => { + disr_vals.push(current_disr_val); + } attr::ReprInt(sp, ity) => { if !disr_in_range(ccx, ity, current_disr_val) { let mut err = struct_span_err!(ccx.tcx.sess, v.span, E0082, @@ -4239,14 +4241,9 @@ pub fn check_enum_variants<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, err.emit(); } } - attr::ReprSimd => { - ccx.tcx.sess.bug("range_to_inttype: found ReprSimd on an enum"); - } - attr::ReprPacked => { - ccx.tcx.sess.bug("range_to_inttype: found ReprPacked on an enum"); - } + // Error reported elsewhere. + attr::ReprSimd | attr::ReprPacked => {} } - disr_vals.push(current_disr_val); } } diff --git a/src/test/compile-fail/cfg-non-opt-expr.rs b/src/test/compile-fail/cfg-non-opt-expr.rs index d9d379ddc7d..b3ef3d72ca3 100644 --- a/src/test/compile-fail/cfg-non-opt-expr.rs +++ b/src/test/compile-fail/cfg-non-opt-expr.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(stmt_expr_attributes)] + fn main() { let _ = #[cfg(unset)] (); //~^ ERROR removing an expression is not supported in this position diff --git a/src/test/compile-fail/double-type-import.rs b/src/test/compile-fail/double-type-import.rs index 923f95e69d1..d6d7dbb4aec 100644 --- a/src/test/compile-fail/double-type-import.rs +++ b/src/test/compile-fail/double-type-import.rs @@ -20,5 +20,5 @@ mod foo { } fn main() { - let _ = foo::X; + let _ = foo::X; //~ ERROR unresolved name `foo::X` } diff --git a/src/test/compile-fail/import-from-missing.rs b/src/test/compile-fail/import-from-missing.rs index f393442de10..489bcfbdefd 100644 --- a/src/test/compile-fail/import-from-missing.rs +++ b/src/test/compile-fail/import-from-missing.rs @@ -16,3 +16,4 @@ mod spam { } fn main() { ham(); eggs(); } +//~^ ERROR unresolved name `eggs` diff --git a/src/test/compile-fail/import.rs b/src/test/compile-fail/import.rs index 844d527a546..86c4ce8b038 100644 --- a/src/test/compile-fail/import.rs +++ b/src/test/compile-fail/import.rs @@ -16,4 +16,4 @@ use zed::baz; mod zed { pub fn bar() { println!("bar"); } } -fn main(args: Vec<String>) { bar(); } +fn main() { bar(); } diff --git a/src/test/compile-fail/import2.rs b/src/test/compile-fail/import2.rs index 6533bd5ddc6..1d2aecd4e3b 100644 --- a/src/test/compile-fail/import2.rs +++ b/src/test/compile-fail/import2.rs @@ -16,4 +16,5 @@ mod baz {} mod zed { pub fn bar() { println!("bar3"); } } -fn main(args: Vec<String>) { bar(); } +fn main() { bar(); } +//~^ ERROR unresolved name `bar` diff --git a/src/test/compile-fail/macro-reexport-malformed-1.rs b/src/test/compile-fail/macro-reexport-malformed-1.rs index 6c85cf5c7f5..ea2dfca0714 100644 --- a/src/test/compile-fail/macro-reexport-malformed-1.rs +++ b/src/test/compile-fail/macro-reexport-malformed-1.rs @@ -8,9 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![no_std] #![feature(macro_reexport)] #[macro_reexport] //~ ERROR bad macro reexport extern crate std; - -fn main() { } diff --git a/src/test/compile-fail/macro-reexport-malformed-2.rs b/src/test/compile-fail/macro-reexport-malformed-2.rs index 1dd0168181f..844955fb7e6 100644 --- a/src/test/compile-fail/macro-reexport-malformed-2.rs +++ b/src/test/compile-fail/macro-reexport-malformed-2.rs @@ -8,9 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![no_std] #![feature(macro_reexport)] #[macro_reexport="foo"] //~ ERROR bad macro reexport extern crate std; - -fn main() { } diff --git a/src/test/compile-fail/macro-reexport-malformed-3.rs b/src/test/compile-fail/macro-reexport-malformed-3.rs index 7ae045f6e4f..381c22854e6 100644 --- a/src/test/compile-fail/macro-reexport-malformed-3.rs +++ b/src/test/compile-fail/macro-reexport-malformed-3.rs @@ -8,9 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![no_std] #![feature(macro_reexport)] #[macro_reexport(foo="bar")] //~ ERROR bad macro reexport extern crate std; - -fn main() { } diff --git a/src/test/compile-fail/macro-reexport-undef.rs b/src/test/compile-fail/macro-reexport-undef.rs index 8fa6b32905c..5bb0b8759f4 100644 --- a/src/test/compile-fail/macro-reexport-undef.rs +++ b/src/test/compile-fail/macro-reexport-undef.rs @@ -10,6 +10,8 @@ // aux-build:two_macros.rs +#![feature(macro_reexport)] + #[macro_use(macro_two)] #[macro_reexport(no_way)] //~ ERROR reexported macro not found extern crate two_macros; diff --git a/src/test/compile-fail/macro-use-bad-args-1.rs b/src/test/compile-fail/macro-use-bad-args-1.rs index a73c4adb71f..39c09c69779 100644 --- a/src/test/compile-fail/macro-use-bad-args-1.rs +++ b/src/test/compile-fail/macro-use-bad-args-1.rs @@ -8,8 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![no_std] + #[macro_use(foo(bar))] //~ ERROR bad macro import extern crate std; - -fn main() { -} diff --git a/src/test/compile-fail/macro-use-bad-args-2.rs b/src/test/compile-fail/macro-use-bad-args-2.rs index 31efe857605..11a0108b99b 100644 --- a/src/test/compile-fail/macro-use-bad-args-2.rs +++ b/src/test/compile-fail/macro-use-bad-args-2.rs @@ -8,8 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![no_std] + #[macro_use(foo="bar")] //~ ERROR bad macro import extern crate std; - -fn main() { -} diff --git a/src/test/compile-fail/privacy3.rs b/src/test/compile-fail/privacy3.rs index da6266bc7ee..6a203993ccf 100644 --- a/src/test/compile-fail/privacy3.rs +++ b/src/test/compile-fail/privacy3.rs @@ -28,6 +28,7 @@ fn test1() { use bar::gpriv; //~^ ERROR unresolved import `bar::gpriv`. There is no `gpriv` in `bar` gpriv(); + //~^ ERROR unresolved name `gpriv` } #[start] fn main(_: isize, _: *const *const u8) -> isize { 3 } diff --git a/src/test/compile-fail/self_type_keyword.rs b/src/test/compile-fail/self_type_keyword.rs index 6f5aeead57e..e28197e81fa 100644 --- a/src/test/compile-fail/self_type_keyword.rs +++ b/src/test/compile-fail/self_type_keyword.rs @@ -29,6 +29,7 @@ pub fn main() { //~^ ERROR expected identifier, found keyword `Self` Self!() => (), //~^ ERROR expected identifier, found keyword `Self` + //~^^ ERROR macro undefined: 'Self!' Foo { x: Self } => (), //~^ ERROR expected identifier, found keyword `Self` Foo { Self } => (), diff --git a/src/test/compile-fail/use-mod.rs b/src/test/compile-fail/use-mod.rs index 15640e386df..9cc3c92e2e3 100644 --- a/src/test/compile-fail/use-mod.rs +++ b/src/test/compile-fail/use-mod.rs @@ -14,6 +14,7 @@ use foo::bar::{ Bar, self //~^ NOTE another `self` import appears here +//~^^ ERROR a module named `bar` has already been imported in this module }; use {self}; |
