about summary refs log tree commit diff
path: root/src/test/compile-fail/const-err.rs
diff options
context:
space:
mode:
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2016-04-01 09:19:29 +0200
committerOliver 'ker' Schneider <git-spam-no-reply9815368754983@oli-obk.de>2016-04-03 15:18:16 +0200
commit913a2b4b0525c75ecf915076c4fd1e16187f8b51 (patch)
tree84a18d70e9bf0c37e407e07fef6c34895fa439a0 /src/test/compile-fail/const-err.rs
parenta09f386e8d1c31133f0ce1123fbeaedcff40a77d (diff)
downloadrust-913a2b4b0525c75ecf915076c4fd1e16187f8b51.tar.gz
rust-913a2b4b0525c75ecf915076c4fd1e16187f8b51.zip
check constants even if they are unused in the current crate
Diffstat (limited to 'src/test/compile-fail/const-err.rs')
-rw-r--r--src/test/compile-fail/const-err.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/test/compile-fail/const-err.rs b/src/test/compile-fail/const-err.rs
index 882e4cb2d47..45e8fc37d87 100644
--- a/src/test/compile-fail/const-err.rs
+++ b/src/test/compile-fail/const-err.rs
@@ -10,15 +10,11 @@
 
 #![feature(rustc_attrs)]
 #![allow(exceeding_bitshifts)]
-#![deny(const_err)]
 
 fn black_box<T>(_: T) {
     unimplemented!()
 }
 
-const BLA: u8 = 200u8 + 200u8;
-//~^ ERROR attempted to add with overflow
-
 #[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
     let a = -std::i8::MIN;
@@ -30,7 +26,8 @@ fn main() {
     //~^ WARN attempted to multiply with overflow
     let d = 42u8 - (42u8 + 1);
     //~^ WARN attempted to subtract with overflow
-    let _e = BLA;
+    let _e = [5u8][1];
+    //~^ ERROR const index-expr is out of bounds
     black_box(a);
     black_box(b);
     black_box(c);