about summary refs log tree commit diff
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
authorOliver Schneider <github35764891676564198441@oli-obk.de>2018-08-26 15:19:34 +0200
committerOliver Scherer <github35764891676564198441@oli-obk.de>2018-10-25 16:46:19 +0200
commit7fdf06cdde49c8cd87e34e85a95c1fe90ebdb0c3 (patch)
tree659449f68fb00da4052dd67ba6725b17d6aaf26d /src/test/ui/error-codes
parent3476ac0bee4042653ecb00207ceb9e02d2b647d0 (diff)
downloadrust-7fdf06cdde49c8cd87e34e85a95c1fe90ebdb0c3.tar.gz
rust-7fdf06cdde49c8cd87e34e85a95c1fe90ebdb0c3.zip
Report const eval error inside the query
Diffstat (limited to 'src/test/ui/error-codes')
-rw-r--r--src/test/ui/error-codes/E0080.rs3
-rw-r--r--src/test/ui/error-codes/E0080.stderr28
-rw-r--r--src/test/ui/error-codes/E0396-fixed.rs2
-rw-r--r--src/test/ui/error-codes/E0396-fixed.stderr2
4 files changed, 5 insertions, 30 deletions
diff --git a/src/test/ui/error-codes/E0080.rs b/src/test/ui/error-codes/E0080.rs
index 7f3e6eaad9b..2ab15dfedca 100644
--- a/src/test/ui/error-codes/E0080.rs
+++ b/src/test/ui/error-codes/E0080.rs
@@ -12,9 +12,6 @@ enum Enum {
     X = (1 << 500), //~ ERROR E0080
     //~| shift left with overflow
     Y = (1 / 0) //~ ERROR E0080
-    //~| const_err
-    //~| const_err
-    //~| const_err
 }
 
 fn main() {
diff --git a/src/test/ui/error-codes/E0080.stderr b/src/test/ui/error-codes/E0080.stderr
index a213c2b1b20..e60c905587d 100644
--- a/src/test/ui/error-codes/E0080.stderr
+++ b/src/test/ui/error-codes/E0080.stderr
@@ -1,37 +1,15 @@
-error: attempt to shift left with overflow
-  --> $DIR/E0080.rs:12:9
-   |
-LL |     X = (1 << 500), //~ ERROR E0080
-   |         ^^^^^^^^^^
-   |
-   = note: #[deny(exceeding_bitshifts)] on by default
-
-error[E0080]: could not evaluate enum discriminant
+error[E0080]: evaluation of constant value failed
   --> $DIR/E0080.rs:12:9
    |
 LL |     X = (1 << 500), //~ ERROR E0080
    |         ^^^^^^^^^^ attempt to shift left with overflow
 
-error: attempt to divide by zero
-  --> $DIR/E0080.rs:14:9
-   |
-LL |     Y = (1 / 0) //~ ERROR E0080
-   |         ^^^^^^^
-   |
-   = note: #[deny(const_err)] on by default
-
-error: this expression will panic at runtime
-  --> $DIR/E0080.rs:14:9
-   |
-LL |     Y = (1 / 0) //~ ERROR E0080
-   |         ^^^^^^^ attempt to divide by zero
-
-error[E0080]: could not evaluate enum discriminant
+error[E0080]: evaluation of constant value failed
   --> $DIR/E0080.rs:14:9
    |
 LL |     Y = (1 / 0) //~ ERROR E0080
    |         ^^^^^^^ attempt to divide by zero
 
-error: aborting due to 5 previous errors
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/error-codes/E0396-fixed.rs b/src/test/ui/error-codes/E0396-fixed.rs
index 08d20e7850d..005f2c36688 100644
--- a/src/test/ui/error-codes/E0396-fixed.rs
+++ b/src/test/ui/error-codes/E0396-fixed.rs
@@ -13,7 +13,7 @@
 const REG_ADDR: *const u8 = 0x5f3759df as *const u8;
 
 const VALUE: u8 = unsafe { *REG_ADDR };
-//~^ ERROR this constant cannot be used
+//~^ ERROR any use of this value will cause an error
 
 fn main() {
 }
diff --git a/src/test/ui/error-codes/E0396-fixed.stderr b/src/test/ui/error-codes/E0396-fixed.stderr
index 7d3c98c8ea8..e868d5a33fa 100644
--- a/src/test/ui/error-codes/E0396-fixed.stderr
+++ b/src/test/ui/error-codes/E0396-fixed.stderr
@@ -1,4 +1,4 @@
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/E0396-fixed.rs:15:1
    |
 LL | const VALUE: u8 = unsafe { *REG_ADDR };