about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorOliver Schneider <github35764891676564198441@oli-obk.de>2018-06-27 14:55:06 +0200
committerOliver Schneider <github35764891676564198441@oli-obk.de>2018-06-28 11:04:26 +0200
commit4d473300a200b26b04335dcd32200878ce8e6e04 (patch)
tree1ed2ecc1771e81b16595211ef887d6425d1a8f0b /src/test
parent4eea1a4e5e28a9a84579ee6a52f115375adefde6 (diff)
downloadrust-4d473300a200b26b04335dcd32200878ce8e6e04.tar.gz
rust-4d473300a200b26b04335dcd32200878ce8e6e04.zip
Turn the use of erroneous constants into errors again
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/const-err.rs2
-rw-r--r--src/test/ui/const-eval/conditional_array_execution.nll.stderr6
-rw-r--r--src/test/ui/const-eval/conditional_array_execution.stderr4
-rw-r--r--src/test/ui/const-eval/issue-43197.nll.stderr10
-rw-r--r--src/test/ui/const-eval/issue-43197.stderr8
-rw-r--r--src/test/ui/const-eval/issue-44578.nll.stderr4
-rw-r--r--src/test/ui/const-eval/issue-44578.stderr2
-rw-r--r--src/test/ui/const-eval/issue-50814-2.stderr2
-rw-r--r--src/test/ui/const-eval/issue-50814.stderr2
-rw-r--r--src/test/ui/const-len-underflow-separate-spans.rs5
-rw-r--r--src/test/ui/const-len-underflow-separate-spans.stderr19
11 files changed, 27 insertions, 37 deletions
diff --git a/src/test/compile-fail/const-err.rs b/src/test/compile-fail/const-err.rs
index f6a64bcba21..8683f6a0231 100644
--- a/src/test/compile-fail/const-err.rs
+++ b/src/test/compile-fail/const-err.rs
@@ -27,4 +27,6 @@ const FOO: u8 = [5u8][1];
 
 fn main() {
     black_box((FOO, FOO));
+    //~^ ERROR referenced constant has errors
+    //~| ERROR could not evaluate constant
 }
diff --git a/src/test/ui/const-eval/conditional_array_execution.nll.stderr b/src/test/ui/const-eval/conditional_array_execution.nll.stderr
index 7be9202a2f5..8bc302a2bef 100644
--- a/src/test/ui/const-eval/conditional_array_execution.nll.stderr
+++ b/src/test/ui/const-eval/conditional_array_execution.nll.stderr
@@ -12,7 +12,7 @@ note: lint level defined here
 LL | #![warn(const_err)]
    |         ^^^^^^^^^
 
-warning: referenced constant
+warning: referenced constant has errors
   --> $DIR/conditional_array_execution.rs:19:20
    |
 LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
@@ -27,7 +27,7 @@ warning: this expression will panic at runtime
 LL |     println!("{}", FOO);
    |                    ^^^ referenced constant has errors
 
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/conditional_array_execution.rs:19:5
    |
 LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
@@ -48,7 +48,7 @@ LL |     println!("{}", FOO);
    |
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/conditional_array_execution.rs:19:20
    |
 LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
diff --git a/src/test/ui/const-eval/conditional_array_execution.stderr b/src/test/ui/const-eval/conditional_array_execution.stderr
index 8a1b7572179..649da03a5e7 100644
--- a/src/test/ui/const-eval/conditional_array_execution.stderr
+++ b/src/test/ui/const-eval/conditional_array_execution.stderr
@@ -12,7 +12,7 @@ note: lint level defined here
 LL | #![warn(const_err)]
    |         ^^^^^^^^^
 
-warning: referenced constant
+warning: referenced constant has errors
   --> $DIR/conditional_array_execution.rs:19:20
    |
 LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
@@ -27,7 +27,7 @@ warning: this expression will panic at runtime
 LL |     println!("{}", FOO);
    |                    ^^^ referenced constant has errors
 
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/conditional_array_execution.rs:19:20
    |
 LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
diff --git a/src/test/ui/const-eval/issue-43197.nll.stderr b/src/test/ui/const-eval/issue-43197.nll.stderr
index 6437369214b..5819e6a9254 100644
--- a/src/test/ui/const-eval/issue-43197.nll.stderr
+++ b/src/test/ui/const-eval/issue-43197.nll.stderr
@@ -20,7 +20,7 @@ LL |     const Y: u32 = foo(0-1);
    |                        |
    |                        attempt to subtract with overflow
 
-warning: referenced constant
+warning: referenced constant has errors
   --> $DIR/issue-43197.rs:24:23
    |
 LL |     const X: u32 = 0-1;
@@ -35,7 +35,7 @@ warning: this expression will panic at runtime
 LL |     println!("{} {}", X, Y);
    |                       ^ referenced constant has errors
 
-warning: referenced constant
+warning: referenced constant has errors
   --> $DIR/issue-43197.rs:24:26
    |
 LL |     const Y: u32 = foo(0-1);
@@ -50,7 +50,7 @@ warning: this expression will panic at runtime
 LL |     println!("{} {}", X, Y);
    |                          ^ referenced constant has errors
 
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/issue-43197.rs:24:5
    |
 LL |     const X: u32 = 0-1;
@@ -71,7 +71,7 @@ LL |     println!("{} {}", X, Y);
    |
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/issue-43197.rs:24:26
    |
 LL |     const Y: u32 = foo(0-1);
@@ -86,7 +86,7 @@ error[E0080]: erroneous constant used
 LL |     println!("{} {}", X, Y);
    |                          ^ referenced constant has errors
 
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/issue-43197.rs:24:23
    |
 LL |     const X: u32 = 0-1;
diff --git a/src/test/ui/const-eval/issue-43197.stderr b/src/test/ui/const-eval/issue-43197.stderr
index 3cb8b345c67..bf864d81ea3 100644
--- a/src/test/ui/const-eval/issue-43197.stderr
+++ b/src/test/ui/const-eval/issue-43197.stderr
@@ -20,7 +20,7 @@ LL |     const Y: u32 = foo(0-1);
    |                        |
    |                        attempt to subtract with overflow
 
-warning: referenced constant
+warning: referenced constant has errors
   --> $DIR/issue-43197.rs:24:23
    |
 LL |     const X: u32 = 0-1;
@@ -35,7 +35,7 @@ warning: this expression will panic at runtime
 LL |     println!("{} {}", X, Y);
    |                       ^ referenced constant has errors
 
-warning: referenced constant
+warning: referenced constant has errors
   --> $DIR/issue-43197.rs:24:26
    |
 LL |     const Y: u32 = foo(0-1);
@@ -50,7 +50,7 @@ warning: this expression will panic at runtime
 LL |     println!("{} {}", X, Y);
    |                          ^ referenced constant has errors
 
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/issue-43197.rs:24:26
    |
 LL |     const Y: u32 = foo(0-1);
@@ -65,7 +65,7 @@ error[E0080]: erroneous constant used
 LL |     println!("{} {}", X, Y);
    |                          ^ referenced constant has errors
 
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/issue-43197.rs:24:23
    |
 LL |     const X: u32 = 0-1;
diff --git a/src/test/ui/const-eval/issue-44578.nll.stderr b/src/test/ui/const-eval/issue-44578.nll.stderr
index ad4f08966c0..eeb152e00ea 100644
--- a/src/test/ui/const-eval/issue-44578.nll.stderr
+++ b/src/test/ui/const-eval/issue-44578.nll.stderr
@@ -1,4 +1,4 @@
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/issue-44578.rs:35:5
    |
 LL |     const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];
@@ -19,7 +19,7 @@ LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
    |
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/issue-44578.rs:35:20
    |
 LL |     const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];
diff --git a/src/test/ui/const-eval/issue-44578.stderr b/src/test/ui/const-eval/issue-44578.stderr
index 28a723a069e..06174f37dca 100644
--- a/src/test/ui/const-eval/issue-44578.stderr
+++ b/src/test/ui/const-eval/issue-44578.stderr
@@ -1,4 +1,4 @@
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/issue-44578.rs:35:20
    |
 LL |     const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];
diff --git a/src/test/ui/const-eval/issue-50814-2.stderr b/src/test/ui/const-eval/issue-50814-2.stderr
index 3c59cb0e2bc..1e37e949812 100644
--- a/src/test/ui/const-eval/issue-50814-2.stderr
+++ b/src/test/ui/const-eval/issue-50814-2.stderr
@@ -1,4 +1,4 @@
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/issue-50814-2.rs:26:5
    |
 LL |     const BAR: usize = [5, 6, 7][T::BOO];
diff --git a/src/test/ui/const-eval/issue-50814.stderr b/src/test/ui/const-eval/issue-50814.stderr
index 145279ccc03..16160207c57 100644
--- a/src/test/ui/const-eval/issue-50814.stderr
+++ b/src/test/ui/const-eval/issue-50814.stderr
@@ -1,4 +1,4 @@
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/issue-50814.rs:27:5
    |
 LL |     const MAX: u8 = A::MAX + B::MAX;
diff --git a/src/test/ui/const-len-underflow-separate-spans.rs b/src/test/ui/const-len-underflow-separate-spans.rs
index 242561da9d5..8db1411005e 100644
--- a/src/test/ui/const-len-underflow-separate-spans.rs
+++ b/src/test/ui/const-len-underflow-separate-spans.rs
@@ -20,7 +20,6 @@ fn main() {
     let a: [i8; LEN] = unimplemented!();
 //~^ ERROR E0080
 //~| ERROR E0080
-//~| ERROR const_err
-//~| ERROR const_err
-//~| ERROR const_err
+//~| ERROR E0080
+//~| ERROR E0080
 }
diff --git a/src/test/ui/const-len-underflow-separate-spans.stderr b/src/test/ui/const-len-underflow-separate-spans.stderr
index a941b0c703f..cf97a0dc555 100644
--- a/src/test/ui/const-len-underflow-separate-spans.stderr
+++ b/src/test/ui/const-len-underflow-separate-spans.stderr
@@ -1,4 +1,4 @@
-error: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/const-len-underflow-separate-spans.rs:20:17
    |
 LL | const LEN: usize = ONE - TWO;
@@ -6,25 +6,14 @@ LL | const LEN: usize = ONE - TWO;
 ...
 LL |     let a: [i8; LEN] = unimplemented!();
    |                 ^^^
-   |
-   = note: #[deny(const_err)] on by default
 
-error: this expression will panic at runtime
+error[E0080]: could not evaluate constant
   --> $DIR/const-len-underflow-separate-spans.rs:20:17
    |
 LL |     let a: [i8; LEN] = unimplemented!();
    |                 ^^^ referenced constant has errors
 
-error: referenced constant
-  --> $DIR/const-len-underflow-separate-spans.rs:20:17
-   |
-LL | const LEN: usize = ONE - TWO;
-   |                    --------- attempt to subtract with overflow
-...
-LL |     let a: [i8; LEN] = unimplemented!();
-   |                 ^^^
-
-error[E0080]: referenced constant
+error[E0080]: referenced constant has errors
   --> $DIR/const-len-underflow-separate-spans.rs:20:12
    |
 LL | const LEN: usize = ONE - TWO;
@@ -41,6 +30,6 @@ LL |     let a: [i8; LEN] = unimplemented!();
    |                 |
    |                 referenced constant has errors
 
-error: aborting due to 5 previous errors
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0080`.