]> git.lizzy.rs Git - rust.git/commitdiff
test fallout
authorNick Cameron <ncameron@mozilla.com>
Wed, 20 Jan 2016 23:16:59 +0000 (12:16 +1300)
committerNick Cameron <ncameron@mozilla.com>
Thu, 21 Jan 2016 19:19:27 +0000 (08:19 +1300)
16 files changed:
src/librustc_driver/driver.rs
src/librustc_typeck/check/mod.rs
src/test/compile-fail/cfg-non-opt-expr.rs
src/test/compile-fail/double-type-import.rs
src/test/compile-fail/import-from-missing.rs
src/test/compile-fail/import.rs
src/test/compile-fail/import2.rs
src/test/compile-fail/macro-reexport-malformed-1.rs
src/test/compile-fail/macro-reexport-malformed-2.rs
src/test/compile-fail/macro-reexport-malformed-3.rs
src/test/compile-fail/macro-reexport-undef.rs
src/test/compile-fail/macro-use-bad-args-1.rs
src/test/compile-fail/macro-use-bad-args-2.rs
src/test/compile-fail/privacy3.rs
src/test/compile-fail/self_type_keyword.rs
src/test/compile-fail/use-mod.rs

index 1db04033f940edd0d4c63c47143eb34c27e66294..36074a7ae0225369e4de694b829eecc00b7389a0 100644 (file)
@@ -70,6 +70,7 @@ macro_rules! controller_entry_point{($point: ident, $tsess: expr, $make_state: e
         (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", || {
index 922ebb3683e80da10c9f37a72541eb71194ae135..a8697f45d9156d9d4dd729b1ec947c25bc9aae9e 100644 (file)
@@ -4229,7 +4229,9 @@ fn do_check<'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 @@ fn do_check<'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);
         }
     }
 
index d9d379ddc7dd59874cbf961bc267e3220e499b94..b3ef3d72ca3bf77a99f9a3f8205a40b77bdaa344 100644 (file)
@@ -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
index 923f95e69d122bb417f7361c34126658c10ffcc2..d6d7dbb4aecd82e05328cddb799024e9c122356e 100644 (file)
@@ -20,5 +20,5 @@ mod bar {
 }
 
 fn main() {
-    let _ = foo::X;
+    let _ = foo::X; //~ ERROR unresolved name `foo::X`
 }
index f393442de10110aefbe849dd157bc64130746948..489bcfbdefdd6cf880a6224a5a6880e6c1d5cf9f 100644 (file)
@@ -16,3 +16,4 @@ pub fn ham() { }
 }
 
 fn main() { ham(); eggs(); }
+//~^ ERROR unresolved name `eggs`
index 844d527a546077a1600c958deeecc6dce9e17caf..86c4ce8b0380b008e6f98b3070a83c45eec46e50 100644 (file)
@@ -16,4 +16,4 @@
 mod zed {
     pub fn bar() { println!("bar"); }
 }
-fn main(args: Vec<String>) { bar(); }
+fn main() { bar(); }
index 6533bd5ddc610cda844a43aa7a708428699b87f0..1d2aecd4e3b7ffa11774a2b6a4608bc248384baf 100644 (file)
@@ -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`
index 6c85cf5c7f5db91db5c73df5b9fca1095ec2c609..ea2dfca0714fc5f35468f8b9293301a1f54a24b9 100644 (file)
@@ -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() { }
index 1dd0168181f83c3f7bebf5375933df21ab22e811..844955fb7e6647a760cb7548f9562c0ac8f370a5 100644 (file)
@@ -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() { }
index 7ae045f6e4f5160a556d407d36206f84a8972bdf..381c22854e6545eac2d476d33496dfbc8ac546ea 100644 (file)
@@ -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() { }
index 8fa6b32905cebb46aa7ec8e978eabb1f773d8e68..5bb0b8759f486c4d0407bc6e750269355be36aa2 100644 (file)
@@ -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;
index a73c4adb71f9ff0e651b535de78e0b15d6aadc22..39c09c6977963350b5903fb4d9728659c2f27233 100644 (file)
@@ -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() {
-}
index 31efe857605b412730e4b943ab7f4e4ab2895d7e..11a0108b99b89a30e8fa1a2cae690cb42b08291f 100644 (file)
@@ -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() {
-}
index da6266bc7ee6b91f32598dc7e04c0648070857d0..6a203993ccf2d2784d8c42cc42f2d955dd139158 100644 (file)
@@ -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 }
index 6f5aeead57ecbff5b0a3adf153a94841b05598fc..e28197e81faf97804af90a6ee0d47fed23d11801 100644 (file)
@@ -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 } => (),
index 15640e386dfa0c968f613dfe386615fddf77e0db..9cc3c92e2e376b22cd2b2e269202d788d664a16f 100644 (file)
@@ -14,6 +14,7 @@
     Bar,
     self
 //~^ NOTE another `self` import appears here
+//~^^ ERROR a module named `bar` has already been imported in this module
 };
 
 use {self};