about summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval
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/consts/const-eval
parent3476ac0bee4042653ecb00207ceb9e02d2b647d0 (diff)
downloadrust-7fdf06cdde49c8cd87e34e85a95c1fe90ebdb0c3.tar.gz
rust-7fdf06cdde49c8cd87e34e85a95c1fe90ebdb0c3.zip
Report const eval error inside the query
Diffstat (limited to 'src/test/ui/consts/const-eval')
-rw-r--r--src/test/ui/consts/const-eval/conditional_array_execution.nll.stderr29
-rw-r--r--src/test/ui/consts/const-eval/conditional_array_execution.rs3
-rw-r--r--src/test/ui/consts/const-eval/conditional_array_execution.stderr15
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-2.stderr6
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-3.stderr16
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-4.rs3
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-4.stderr16
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2.rs41
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2.stderr115
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2b.rs41
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2b.stderr115
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2c.rs41
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2c.stderr115
-rw-r--r--src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs44
-rw-r--r--src/test/ui/consts/const-eval/const_panic.rs15
-rw-r--r--src/test/ui/consts/const-eval/const_panic.stderr36
-rw-r--r--src/test/ui/consts/const-eval/const_panic_libcore.rs6
-rw-r--r--src/test/ui/consts/const-eval/const_panic_libcore.stderr6
-rw-r--r--src/test/ui/consts/const-eval/const_panic_libcore_main.rs6
-rw-r--r--src/test/ui/consts/const-eval/const_panic_libcore_main.stderr12
-rw-r--r--src/test/ui/consts/const-eval/const_raw_ptr_ops.rs8
-rw-r--r--src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr16
-rw-r--r--src/test/ui/consts/const-eval/double_check2.stderr2
-rw-r--r--src/test/ui/consts/const-eval/infinite_loop.rs2
-rw-r--r--src/test/ui/consts/const-eval/infinite_loop.stderr23
-rw-r--r--src/test/ui/consts/const-eval/issue-43197.nll.stderr43
-rw-r--r--src/test/ui/consts/const-eval/issue-43197.rs10
-rw-r--r--src/test/ui/consts/const-eval/issue-43197.stderr36
-rw-r--r--src/test/ui/consts/const-eval/issue-44578.nll.stderr15
-rw-r--r--src/test/ui/consts/const-eval/issue-44578.rs3
-rw-r--r--src/test/ui/consts/const-eval/issue-44578.stderr13
-rw-r--r--src/test/ui/consts/const-eval/issue-50814-2.rs5
-rw-r--r--src/test/ui/consts/const-eval/issue-50814-2.stderr19
-rw-r--r--src/test/ui/consts/const-eval/issue-50814.rs5
-rw-r--r--src/test/ui/consts/const-eval/issue-50814.stderr19
-rw-r--r--src/test/ui/consts/const-eval/issue-52443.stderr49
-rw-r--r--src/test/ui/consts/const-eval/match-test-ptr-null.rs3
-rw-r--r--src/test/ui/consts/const-eval/match-test-ptr-null.stderr16
-rw-r--r--src/test/ui/consts/const-eval/promoted_const_fn_fail.rs2
-rw-r--r--src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs36
-rw-r--r--src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr19
-rw-r--r--src/test/ui/consts/const-eval/promoted_errors.stderr12
-rw-r--r--src/test/ui/consts/const-eval/pub_const_err.rs2
-rw-r--r--src/test/ui/consts/const-eval/pub_const_err.stderr14
-rw-r--r--src/test/ui/consts/const-eval/pub_const_err_bin.rs2
-rw-r--r--src/test/ui/consts/const-eval/pub_const_err_bin.stderr14
-rw-r--r--src/test/ui/consts/const-eval/shift_overflow.stderr2
-rw-r--r--src/test/ui/consts/const-eval/ub-enum.rs6
-rw-r--r--src/test/ui/consts/const-eval/ub-enum.stderr6
-rw-r--r--src/test/ui/consts/const-eval/union-const-eval-field.rs5
-rw-r--r--src/test/ui/consts/const-eval/union-const-eval-field.stderr32
-rw-r--r--src/test/ui/consts/const-eval/union-ice.rs6
-rw-r--r--src/test/ui/consts/const-eval/union-ice.stderr12
-rw-r--r--src/test/ui/consts/const-eval/union-ub-fat-ptr.rs29
-rw-r--r--src/test/ui/consts/const-eval/union-ub-fat-ptr.stderr38
-rw-r--r--src/test/ui/consts/const-eval/union-ub.rs2
-rw-r--r--src/test/ui/consts/const-eval/union-ub.stderr2
57 files changed, 737 insertions, 472 deletions
diff --git a/src/test/ui/consts/const-eval/conditional_array_execution.nll.stderr b/src/test/ui/consts/const-eval/conditional_array_execution.nll.stderr
new file mode 100644
index 00000000000..b6c35b8ebbd
--- /dev/null
+++ b/src/test/ui/consts/const-eval/conditional_array_execution.nll.stderr
@@ -0,0 +1,29 @@
+warning: any use of this value will cause an error
+  --> $DIR/conditional_array_execution.rs:15:1
+   |
+LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
+   | ^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                   |
+   |                   attempt to subtract with overflow
+   |
+note: lint level defined here
+  --> $DIR/conditional_array_execution.rs:11:9
+   |
+LL | #![warn(const_err)]
+   |         ^^^^^^^^^
+
+error[E0080]: evaluation of constant expression failed
+  --> $DIR/conditional_array_execution.rs:19:14
+   |
+LL |     println!("{}", FOO);
+   |              ^^^^  --- referenced constant has errors
+
+error[E0080]: evaluation of constant expression failed
+  --> $DIR/conditional_array_execution.rs:19:20
+   |
+LL |     println!("{}", FOO);
+   |                    ^^^ referenced constant has errors
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/conditional_array_execution.rs b/src/test/ui/consts/const-eval/conditional_array_execution.rs
index 8142ed0155a..4e245c6b9e8 100644
--- a/src/test/ui/consts/const-eval/conditional_array_execution.rs
+++ b/src/test/ui/consts/const-eval/conditional_array_execution.rs
@@ -13,10 +13,9 @@
 const X: u32 = 5;
 const Y: u32 = 6;
 const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
-//~^ WARN this constant cannot be used
+//~^ WARN any use of this value will cause an error
 
 fn main() {
     println!("{}", FOO);
     //~^ ERROR
-    //~| ERROR
 }
diff --git a/src/test/ui/consts/const-eval/conditional_array_execution.stderr b/src/test/ui/consts/const-eval/conditional_array_execution.stderr
index 29f5f8e2ade..90131080ed1 100644
--- a/src/test/ui/consts/const-eval/conditional_array_execution.stderr
+++ b/src/test/ui/consts/const-eval/conditional_array_execution.stderr
@@ -1,4 +1,4 @@
-warning: this constant cannot be used
+warning: any use of this value will cause an error
   --> $DIR/conditional_array_execution.rs:15:1
    |
 LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
@@ -12,21 +12,12 @@ note: lint level defined here
 LL | #![warn(const_err)]
    |         ^^^^^^^^^
 
-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];
-   |                   ----- attempt to subtract with overflow
-...
-LL |     println!("{}", FOO);
-   |                    ^^^
-
-error[E0080]: erroneous constant used
+error[E0080]: evaluation of constant expression failed
   --> $DIR/conditional_array_execution.rs:19:20
    |
 LL |     println!("{}", FOO);
    |                    ^^^ referenced constant has errors
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr
index e99d409880e..70c98977301 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr
@@ -1,12 +1,8 @@
-error[E0080]: could not evaluate constant pattern
+error: could not evaluate constant pattern
   --> $DIR/const-eval-overflow-2.rs:25:9
    |
-LL | const NEG_NEG_128: i8 = -NEG_128;
-   |                         -------- attempt to negate with overflow
-...
 LL |         NEG_NEG_128 => println!("A"),
    |         ^^^^^^^^^^^
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-3.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-3.stderr
index f2b4e6b3b56..bcef9eff2f8 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow-3.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow-3.stderr
@@ -1,19 +1,9 @@
-error: attempt to add with overflow
+error[E0080]: evaluation of constant value failed
   --> $DIR/const-eval-overflow-3.rs:30:11
    |
 LL |     = [0; (i8::MAX + 1) as usize];
-   |           ^^^^^^^^^^^^^
-   |
-   = note: #[deny(const_err)] on by default
-
-error[E0080]: could not evaluate repeat length
-  --> $DIR/const-eval-overflow-3.rs:30:11
-   |
-LL |     = [0; (i8::MAX + 1) as usize];
-   |           -------------^^^^^^^^^
-   |           |
-   |           attempt to add with overflow
+   |           ^^^^^^^^^^^^^ attempt to add with overflow
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-4.rs b/src/test/ui/consts/const-eval/const-eval-overflow-4.rs
index e9fc8ec0c37..5d692d9d7fc 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow-4.rs
+++ b/src/test/ui/consts/const-eval/const-eval-overflow-4.rs
@@ -21,8 +21,7 @@ use std::{u8, u16, u32, u64, usize};
 
 const A_I8_T
     : [u32; (i8::MAX as i8 + 1i8) as usize]
-    //~^ ERROR attempt to add with overflow
-    //~| ERROR could not evaluate constant expression
+    //~^ ERROR evaluation of constant value failed
     = [0; (i8::MAX as usize) + 1];
 
 fn main() {
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-4.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-4.stderr
index b12aa032b60..fd186dc719c 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow-4.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow-4.stderr
@@ -1,19 +1,9 @@
-error: attempt to add with overflow
+error[E0080]: evaluation of constant value failed
   --> $DIR/const-eval-overflow-4.rs:23:13
    |
 LL |     : [u32; (i8::MAX as i8 + 1i8) as usize]
-   |             ^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: #[deny(const_err)] on by default
-
-error[E0080]: could not evaluate constant expression
-  --> $DIR/const-eval-overflow-4.rs:23:7
-   |
-LL |     : [u32; (i8::MAX as i8 + 1i8) as usize]
-   |       ^^^^^^---------------------^^^^^^^^^^
-   |             |
-   |             attempt to add with overflow
+   |             ^^^^^^^^^^^^^^^^^^^^^ attempt to add with overflow
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2.rs b/src/test/ui/consts/const-eval/const-eval-overflow2.rs
index 88fc5182775..ee29423a90c 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2.rs
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2.rs
@@ -21,62 +21,55 @@ use std::fmt;
 use std::{i8, i16, i32, i64, isize};
 use std::{u8, u16, u32, u64, usize};
 
-const VALS_I8: (i8,) =
-     //~^ ERROR this constant cannot be used
+const VALS_I8: (i8,) = //~ ERROR any use of this value will cause an error
+     //~^ const_err
     (
      i8::MIN - 1,
      );
 
-const VALS_I16: (i16,) =
-     //~^ ERROR this constant cannot be used
+const VALS_I16: (i16,) = //~ ERROR any use of this value will cause an error
     (
      i16::MIN - 1,
      );
 
-const VALS_I32: (i32,) =
-     //~^ ERROR this constant cannot be used
+const VALS_I32: (i32,) = //~ ERROR any use of this value will cause an error
     (
      i32::MIN - 1,
      );
 
-const VALS_I64: (i64,) =
-     //~^ ERROR this constant cannot be used
+const VALS_I64: (i64,) = //~ ERROR any use of this value will cause an error
     (
      i64::MIN - 1,
      );
 
-const VALS_U8: (u8,) =
-     //~^ ERROR this constant cannot be used
+const VALS_U8: (u8,) = //~ ERROR any use of this value will cause an error
     (
      u8::MIN - 1,
      );
 
-const VALS_U16: (u16,) = (
-     //~^ ERROR this constant cannot be used
+const VALS_U16: (u16,) = ( //~ ERROR any use of this value will cause an error
      u16::MIN - 1,
      );
 
-const VALS_U32: (u32,) = (
-     //~^ ERROR this constant cannot be used
+const VALS_U32: (u32,) = ( //~ ERROR any use of this value will cause an error
      u32::MIN - 1,
      );
 
-const VALS_U64: (u64,) =
-     //~^ ERROR this constant cannot be used
+const VALS_U64: (u64,) = //~ ERROR any use of this value will cause an error
     (
      u64::MIN - 1,
      );
 
 fn main() {
-    foo(VALS_I8);
-    foo(VALS_I16);
-    foo(VALS_I32);
-    foo(VALS_I64);
+    foo(VALS_I8); //~ ERROR erroneous constant used
+    foo(VALS_I16); //~ ERROR erroneous constant used
+    foo(VALS_I32); //~ ERROR erroneous constant used
+    foo(VALS_I64); //~ ERROR erroneous constant used
 
-    foo(VALS_U8);
-    foo(VALS_U16);
-    foo(VALS_U32);
-    foo(VALS_U64);
+    foo(VALS_U8); //~ ERROR erroneous constant used
+    foo(VALS_U16); //~ ERROR erroneous constant used
+    foo(VALS_U32); //~ ERROR erroneous constant used
+    foo(VALS_U64); //~ ERROR erroneous constant used
 }
 
 fn foo<T>(_: T) {
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2.stderr
index 5cf5ce367e2..f10a6eee6de 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2.stderr
@@ -1,8 +1,8 @@
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/const-eval-overflow2.rs:24:1
    |
-LL | / const VALS_I8: (i8,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_I8: (i8,) = //~ ERROR any use of this value will cause an error
+LL | |      //~^ const_err
 LL | |     (
 LL | |      i8::MIN - 1,
    | |      ----------- attempt to subtract with overflow
@@ -15,80 +15,133 @@ note: lint level defined here
 LL | #![deny(const_err)]
    |         ^^^^^^^^^
 
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/const-eval-overflow2.rs:30:1
    |
-LL | / const VALS_I16: (i16,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_I16: (i16,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      i16::MIN - 1,
    | |      ------------ attempt to subtract with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2.rs:36:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2.rs:35:1
    |
-LL | / const VALS_I32: (i32,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_I32: (i32,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      i32::MIN - 1,
    | |      ------------ attempt to subtract with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2.rs:42:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2.rs:40:1
    |
-LL | / const VALS_I64: (i64,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_I64: (i64,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      i64::MIN - 1,
    | |      ------------ attempt to subtract with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2.rs:48:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2.rs:45:1
    |
-LL | / const VALS_U8: (u8,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_U8: (u8,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      u8::MIN - 1,
    | |      ----------- attempt to subtract with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2.rs:54:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2.rs:50:1
    |
-LL | / const VALS_U16: (u16,) = (
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_U16: (u16,) = ( //~ ERROR any use of this value will cause an error
 LL | |      u16::MIN - 1,
    | |      ------------ attempt to subtract with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2.rs:59:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2.rs:54:1
    |
-LL | / const VALS_U32: (u32,) = (
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_U32: (u32,) = ( //~ ERROR any use of this value will cause an error
 LL | |      u32::MIN - 1,
    | |      ------------ attempt to subtract with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2.rs:64:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2.rs:58:1
    |
-LL | / const VALS_U64: (u64,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_U64: (u64,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      u64::MIN - 1,
    | |      ------------ attempt to subtract with overflow
 LL | |      );
    | |_______^
 
-error: aborting due to 8 previous errors
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2.rs:24:1
+   |
+LL | / const VALS_I8: (i8,) = //~ ERROR any use of this value will cause an error
+LL | |      //~^ const_err
+LL | |     (
+LL | |      i8::MIN - 1,
+   | |      ----------- attempt to subtract with overflow
+LL | |      );
+   | |_______^
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2.rs:64:5
+   |
+LL |     foo(VALS_I8); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2.rs:65:5
+   |
+LL |     foo(VALS_I16); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2.rs:66:5
+   |
+LL |     foo(VALS_I32); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2.rs:67:5
+   |
+LL |     foo(VALS_I64); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2.rs:69:5
+   |
+LL |     foo(VALS_U8); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2.rs:70:5
+   |
+LL |     foo(VALS_U16); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2.rs:71:5
+   |
+LL |     foo(VALS_U32); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2.rs:72:5
+   |
+LL |     foo(VALS_U64); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error: aborting due to 17 previous errors
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2b.rs b/src/test/ui/consts/const-eval/const-eval-overflow2b.rs
index 1878daea931..55dc2a89405 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2b.rs
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2b.rs
@@ -21,62 +21,55 @@ use std::fmt;
 use std::{i8, i16, i32, i64, isize};
 use std::{u8, u16, u32, u64, usize};
 
-const VALS_I8: (i8,) =
-     //~^ ERROR this constant cannot be used
+const VALS_I8: (i8,) = //~ ERROR any use of this value will cause an error
+     //~^ const_err
     (
      i8::MAX + 1,
      );
 
-const VALS_I16: (i16,) =
-     //~^ ERROR this constant cannot be used
+const VALS_I16: (i16,) = //~ ERROR any use of this value will cause an error
     (
      i16::MAX + 1,
      );
 
-const VALS_I32: (i32,) =
-     //~^ ERROR this constant cannot be used
+const VALS_I32: (i32,) = //~ ERROR any use of this value will cause an error
     (
      i32::MAX + 1,
      );
 
-const VALS_I64: (i64,) =
-     //~^ ERROR this constant cannot be used
+const VALS_I64: (i64,) = //~ ERROR any use of this value will cause an error
     (
      i64::MAX + 1,
      );
 
-const VALS_U8: (u8,) =
-     //~^ ERROR this constant cannot be used
+const VALS_U8: (u8,) = //~ ERROR any use of this value will cause an error
     (
      u8::MAX + 1,
      );
 
-const VALS_U16: (u16,) = (
-     //~^ ERROR this constant cannot be used
+const VALS_U16: (u16,) = ( //~ ERROR any use of this value will cause an error
      u16::MAX + 1,
      );
 
-const VALS_U32: (u32,) = (
-     //~^ ERROR this constant cannot be used
+const VALS_U32: (u32,) = ( //~ ERROR any use of this value will cause an error
      u32::MAX + 1,
      );
 
-const VALS_U64: (u64,) =
-     //~^ ERROR this constant cannot be used
+const VALS_U64: (u64,) = //~ ERROR any use of this value will cause an error
     (
      u64::MAX + 1,
      );
 
 fn main() {
-    foo(VALS_I8);
-    foo(VALS_I16);
-    foo(VALS_I32);
-    foo(VALS_I64);
+    foo(VALS_I8); //~ ERROR erroneous constant used
+    foo(VALS_I16); //~ ERROR erroneous constant used
+    foo(VALS_I32); //~ ERROR erroneous constant used
+    foo(VALS_I64); //~ ERROR erroneous constant used
 
-    foo(VALS_U8);
-    foo(VALS_U16);
-    foo(VALS_U32);
-    foo(VALS_U64);
+    foo(VALS_U8); //~ ERROR erroneous constant used
+    foo(VALS_U16); //~ ERROR erroneous constant used
+    foo(VALS_U32); //~ ERROR erroneous constant used
+    foo(VALS_U64); //~ ERROR erroneous constant used
 }
 
 fn foo<T>(_: T) {
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr
index 458a9e11e75..3b78fb51a62 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr
@@ -1,8 +1,8 @@
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/const-eval-overflow2b.rs:24:1
    |
-LL | / const VALS_I8: (i8,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_I8: (i8,) = //~ ERROR any use of this value will cause an error
+LL | |      //~^ const_err
 LL | |     (
 LL | |      i8::MAX + 1,
    | |      ----------- attempt to add with overflow
@@ -15,80 +15,133 @@ note: lint level defined here
 LL | #![deny(const_err)]
    |         ^^^^^^^^^
 
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/const-eval-overflow2b.rs:30:1
    |
-LL | / const VALS_I16: (i16,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_I16: (i16,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      i16::MAX + 1,
    | |      ------------ attempt to add with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2b.rs:36:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2b.rs:35:1
    |
-LL | / const VALS_I32: (i32,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_I32: (i32,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      i32::MAX + 1,
    | |      ------------ attempt to add with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2b.rs:42:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2b.rs:40:1
    |
-LL | / const VALS_I64: (i64,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_I64: (i64,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      i64::MAX + 1,
    | |      ------------ attempt to add with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2b.rs:48:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2b.rs:45:1
    |
-LL | / const VALS_U8: (u8,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_U8: (u8,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      u8::MAX + 1,
    | |      ----------- attempt to add with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2b.rs:54:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2b.rs:50:1
    |
-LL | / const VALS_U16: (u16,) = (
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_U16: (u16,) = ( //~ ERROR any use of this value will cause an error
 LL | |      u16::MAX + 1,
    | |      ------------ attempt to add with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2b.rs:59:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2b.rs:54:1
    |
-LL | / const VALS_U32: (u32,) = (
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_U32: (u32,) = ( //~ ERROR any use of this value will cause an error
 LL | |      u32::MAX + 1,
    | |      ------------ attempt to add with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2b.rs:64:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2b.rs:58:1
    |
-LL | / const VALS_U64: (u64,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_U64: (u64,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      u64::MAX + 1,
    | |      ------------ attempt to add with overflow
 LL | |      );
    | |_______^
 
-error: aborting due to 8 previous errors
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2b.rs:24:1
+   |
+LL | / const VALS_I8: (i8,) = //~ ERROR any use of this value will cause an error
+LL | |      //~^ const_err
+LL | |     (
+LL | |      i8::MAX + 1,
+   | |      ----------- attempt to add with overflow
+LL | |      );
+   | |_______^
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2b.rs:64:5
+   |
+LL |     foo(VALS_I8); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2b.rs:65:5
+   |
+LL |     foo(VALS_I16); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2b.rs:66:5
+   |
+LL |     foo(VALS_I32); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2b.rs:67:5
+   |
+LL |     foo(VALS_I64); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2b.rs:69:5
+   |
+LL |     foo(VALS_U8); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2b.rs:70:5
+   |
+LL |     foo(VALS_U16); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2b.rs:71:5
+   |
+LL |     foo(VALS_U32); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2b.rs:72:5
+   |
+LL |     foo(VALS_U64); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error: aborting due to 17 previous errors
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2c.rs b/src/test/ui/consts/const-eval/const-eval-overflow2c.rs
index f3d28295bf8..93ba11efc59 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2c.rs
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2c.rs
@@ -21,62 +21,55 @@ use std::fmt;
 use std::{i8, i16, i32, i64, isize};
 use std::{u8, u16, u32, u64, usize};
 
-const VALS_I8: (i8,) =
-     //~^ ERROR this constant cannot be used
+const VALS_I8: (i8,) = //~ ERROR any use of this value will cause an error
+     //~^ const_err
     (
      i8::MIN * 2,
      );
 
-const VALS_I16: (i16,) =
-     //~^ ERROR this constant cannot be used
+const VALS_I16: (i16,) = //~ ERROR any use of this value will cause an error
     (
      i16::MIN * 2,
      );
 
-const VALS_I32: (i32,) =
-     //~^ ERROR this constant cannot be used
+const VALS_I32: (i32,) = //~ ERROR any use of this value will cause an error
     (
      i32::MIN * 2,
      );
 
-const VALS_I64: (i64,) =
-     //~^ ERROR this constant cannot be used
+const VALS_I64: (i64,) = //~ ERROR any use of this value will cause an error
     (
      i64::MIN * 2,
      );
 
-const VALS_U8: (u8,) =
-     //~^ ERROR this constant cannot be used
+const VALS_U8: (u8,) = //~ ERROR any use of this value will cause an error
     (
      u8::MAX * 2,
      );
 
-const VALS_U16: (u16,) = (
-     //~^ ERROR this constant cannot be used
+const VALS_U16: (u16,) = ( //~ ERROR any use of this value will cause an error
      u16::MAX * 2,
      );
 
-const VALS_U32: (u32,) = (
-     //~^ ERROR this constant cannot be used
+const VALS_U32: (u32,) = ( //~ ERROR any use of this value will cause an error
      u32::MAX * 2,
      );
 
-const VALS_U64: (u64,) =
-     //~^ ERROR this constant cannot be used
+const VALS_U64: (u64,) = //~ ERROR any use of this value will cause an error
     (
      u64::MAX * 2,
      );
 
 fn main() {
-    foo(VALS_I8);
-    foo(VALS_I16);
-    foo(VALS_I32);
-    foo(VALS_I64);
+    foo(VALS_I8); //~ ERROR erroneous constant used
+    foo(VALS_I16); //~ ERROR erroneous constant used
+    foo(VALS_I32); //~ ERROR erroneous constant used
+    foo(VALS_I64); //~ ERROR erroneous constant used
 
-    foo(VALS_U8);
-    foo(VALS_U16);
-    foo(VALS_U32);
-    foo(VALS_U64);
+    foo(VALS_U8); //~ ERROR erroneous constant used
+    foo(VALS_U16); //~ ERROR erroneous constant used
+    foo(VALS_U32); //~ ERROR erroneous constant used
+    foo(VALS_U64); //~ ERROR erroneous constant used
 }
 
 fn foo<T>(_: T) {
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr
index 866860281cf..abaae4bd542 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr
@@ -1,8 +1,8 @@
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/const-eval-overflow2c.rs:24:1
    |
-LL | / const VALS_I8: (i8,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_I8: (i8,) = //~ ERROR any use of this value will cause an error
+LL | |      //~^ const_err
 LL | |     (
 LL | |      i8::MIN * 2,
    | |      ----------- attempt to multiply with overflow
@@ -15,80 +15,133 @@ note: lint level defined here
 LL | #![deny(const_err)]
    |         ^^^^^^^^^
 
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/const-eval-overflow2c.rs:30:1
    |
-LL | / const VALS_I16: (i16,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_I16: (i16,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      i16::MIN * 2,
    | |      ------------ attempt to multiply with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2c.rs:36:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2c.rs:35:1
    |
-LL | / const VALS_I32: (i32,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_I32: (i32,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      i32::MIN * 2,
    | |      ------------ attempt to multiply with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2c.rs:42:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2c.rs:40:1
    |
-LL | / const VALS_I64: (i64,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_I64: (i64,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      i64::MIN * 2,
    | |      ------------ attempt to multiply with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2c.rs:48:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2c.rs:45:1
    |
-LL | / const VALS_U8: (u8,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_U8: (u8,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      u8::MAX * 2,
    | |      ----------- attempt to multiply with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2c.rs:54:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2c.rs:50:1
    |
-LL | / const VALS_U16: (u16,) = (
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_U16: (u16,) = ( //~ ERROR any use of this value will cause an error
 LL | |      u16::MAX * 2,
    | |      ------------ attempt to multiply with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2c.rs:59:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2c.rs:54:1
    |
-LL | / const VALS_U32: (u32,) = (
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_U32: (u32,) = ( //~ ERROR any use of this value will cause an error
 LL | |      u32::MAX * 2,
    | |      ------------ attempt to multiply with overflow
 LL | |      );
    | |_______^
 
-error: this constant cannot be used
-  --> $DIR/const-eval-overflow2c.rs:64:1
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2c.rs:58:1
    |
-LL | / const VALS_U64: (u64,) =
-LL | |      //~^ ERROR this constant cannot be used
+LL | / const VALS_U64: (u64,) = //~ ERROR any use of this value will cause an error
 LL | |     (
 LL | |      u64::MAX * 2,
    | |      ------------ attempt to multiply with overflow
 LL | |      );
    | |_______^
 
-error: aborting due to 8 previous errors
+error: any use of this value will cause an error
+  --> $DIR/const-eval-overflow2c.rs:24:1
+   |
+LL | / const VALS_I8: (i8,) = //~ ERROR any use of this value will cause an error
+LL | |      //~^ const_err
+LL | |     (
+LL | |      i8::MIN * 2,
+   | |      ----------- attempt to multiply with overflow
+LL | |      );
+   | |_______^
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2c.rs:64:5
+   |
+LL |     foo(VALS_I8); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2c.rs:65:5
+   |
+LL |     foo(VALS_I16); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2c.rs:66:5
+   |
+LL |     foo(VALS_I32); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2c.rs:67:5
+   |
+LL |     foo(VALS_I64); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2c.rs:69:5
+   |
+LL |     foo(VALS_U8); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2c.rs:70:5
+   |
+LL |     foo(VALS_U16); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2c.rs:71:5
+   |
+LL |     foo(VALS_U32); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+  --> $DIR/const-eval-overflow2c.rs:72:5
+   |
+LL |     foo(VALS_U64); //~ ERROR erroneous constant used
+   |     ^^^^^^^^^^^^^ referenced constant has errors
+
+error: aborting due to 17 previous errors
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
index dc84e2a88d6..05d79a7d633 100644
--- a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
+++ b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
@@ -25,86 +25,86 @@ fn main() {
     //~^ ERROR this constant likely exhibits undefined behavior
 
     const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
     //~^ ERROR this constant likely exhibits undefined behavior
 
     const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.uint_128 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
     //~^ ERROR this constant likely exhibits undefined behavior
 
     const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
     //~^ ERROR this constant likely exhibits undefined behavior
 
     const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
     //~^ ERROR this constant likely exhibits undefined behavior
 
     const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
     //~^ ERROR this constant likely exhibits undefined behavior
 
     const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
     //~^ ERROR this constant likely exhibits undefined behavior
 
     const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 
     const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
-    //~^ ERROR this constant cannot be used
+    //~^ ERROR any use of this value will cause an error
 }
diff --git a/src/test/ui/consts/const-eval/const_panic.rs b/src/test/ui/consts/const-eval/const_panic.rs
index f2170f509eb..9af631afed4 100644
--- a/src/test/ui/consts/const-eval/const_panic.rs
+++ b/src/test/ui/consts/const-eval/const_panic.rs
@@ -9,14 +9,13 @@
 // except according to those terms.
 
 #![feature(const_panic)]
+#![crate_type = "lib"]
 
-fn main() {}
+pub const Z: () = panic!("cheese");
+//~^ ERROR any use of this value will cause an error
 
-const Z: () = panic!("cheese");
-//~^ ERROR this constant cannot be used
+pub const Y: () = unreachable!();
+//~^ ERROR any use of this value will cause an error
 
-const Y: () = unreachable!();
-//~^ ERROR this constant cannot be used
-
-const X: () = unimplemented!();
-//~^ ERROR this constant cannot be used
+pub const X: () = unimplemented!();
+//~^ ERROR any use of this value will cause an error
diff --git a/src/test/ui/consts/const-eval/const_panic.stderr b/src/test/ui/consts/const-eval/const_panic.stderr
index c11146f4882..fcdbcbf5bfa 100644
--- a/src/test/ui/consts/const-eval/const_panic.stderr
+++ b/src/test/ui/consts/const-eval/const_panic.stderr
@@ -1,31 +1,31 @@
-error: this constant cannot be used
-  --> $DIR/const_panic.rs:15:1
+error: any use of this value will cause an error
+  --> $DIR/const_panic.rs:14:1
    |
-LL | const Z: () = panic!("cheese");
-   | ^^^^^^^^^^^^^^----------------^
-   |               |
-   |               the evaluated program panicked at 'cheese', $DIR/const_panic.rs:15:15
+LL | pub const Z: () = panic!("cheese");
+   | ^^^^^^^^^^^^^^^^^^----------------^
+   |                   |
+   |                   the evaluated program panicked at 'cheese', $DIR/const_panic.rs:14:19
    |
    = note: #[deny(const_err)] on by default
    = 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: this constant cannot be used
-  --> $DIR/const_panic.rs:18:1
+error: any use of this value will cause an error
+  --> $DIR/const_panic.rs:17:1
    |
-LL | const Y: () = unreachable!();
-   | ^^^^^^^^^^^^^^--------------^
-   |               |
-   |               the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic.rs:18:15
+LL | pub const Y: () = unreachable!();
+   | ^^^^^^^^^^^^^^^^^^--------------^
+   |                   |
+   |                   the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic.rs:17:19
    |
    = 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: this constant cannot be used
-  --> $DIR/const_panic.rs:21:1
+error: any use of this value will cause an error
+  --> $DIR/const_panic.rs:20:1
    |
-LL | const X: () = unimplemented!();
-   | ^^^^^^^^^^^^^^----------------^
-   |               |
-   |               the evaluated program panicked at 'not yet implemented', $DIR/const_panic.rs:21:15
+LL | pub const X: () = unimplemented!();
+   | ^^^^^^^^^^^^^^^^^^----------------^
+   |                   |
+   |                   the evaluated program panicked at 'not yet implemented', $DIR/const_panic.rs:20:19
    |
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
diff --git a/src/test/ui/consts/const-eval/const_panic_libcore.rs b/src/test/ui/consts/const-eval/const_panic_libcore.rs
index 59aeca18129..11da8742b10 100644
--- a/src/test/ui/consts/const-eval/const_panic_libcore.rs
+++ b/src/test/ui/consts/const-eval/const_panic_libcore.rs
@@ -13,10 +13,10 @@
 #![feature(const_panic)]
 
 const Z: () = panic!("cheese");
-//~^ ERROR this constant cannot be used
+//~^ ERROR any use of this value will cause an error
 
 const Y: () = unreachable!();
-//~^ ERROR this constant cannot be used
+//~^ ERROR any use of this value will cause an error
 
 const X: () = unimplemented!();
-//~^ ERROR this constant cannot be used
+//~^ ERROR any use of this value will cause an error
diff --git a/src/test/ui/consts/const-eval/const_panic_libcore.stderr b/src/test/ui/consts/const-eval/const_panic_libcore.stderr
index 45f2ee7744e..a8f04b96a8b 100644
--- a/src/test/ui/consts/const-eval/const_panic_libcore.stderr
+++ b/src/test/ui/consts/const-eval/const_panic_libcore.stderr
@@ -1,4 +1,4 @@
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/const_panic_libcore.rs:15:1
    |
 LL | const Z: () = panic!("cheese");
@@ -9,7 +9,7 @@ LL | const Z: () = panic!("cheese");
    = note: #[deny(const_err)] on by default
    = 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: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/const_panic_libcore.rs:18:1
    |
 LL | const Y: () = unreachable!();
@@ -19,7 +19,7 @@ LL | const Y: () = unreachable!();
    |
    = 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: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/const_panic_libcore.rs:21:1
    |
 LL | const X: () = unimplemented!();
diff --git a/src/test/ui/consts/const-eval/const_panic_libcore_main.rs b/src/test/ui/consts/const-eval/const_panic_libcore_main.rs
index 0364123994d..03365ae46ab 100644
--- a/src/test/ui/consts/const-eval/const_panic_libcore_main.rs
+++ b/src/test/ui/consts/const-eval/const_panic_libcore_main.rs
@@ -17,13 +17,13 @@
 use core::panic::PanicInfo;
 
 const Z: () = panic!("cheese");
-//~^ ERROR this constant cannot be used
+//~^ ERROR any use of this value will cause an error
 
 const Y: () = unreachable!();
-//~^ ERROR this constant cannot be used
+//~^ ERROR any use of this value will cause an error
 
 const X: () = unimplemented!();
-//~^ ERROR this constant cannot be used
+//~^ ERROR any use of this value will cause an error
 
 #[lang = "eh_personality"]
 fn eh() {}
diff --git a/src/test/ui/consts/const-eval/const_panic_libcore_main.stderr b/src/test/ui/consts/const-eval/const_panic_libcore_main.stderr
index 44b30c08cde..9a7c510029c 100644
--- a/src/test/ui/consts/const-eval/const_panic_libcore_main.stderr
+++ b/src/test/ui/consts/const-eval/const_panic_libcore_main.stderr
@@ -1,5 +1,5 @@
-error: this constant cannot be used
-  --> $DIR/const_panic_libcore_main.rs:19:1
+error: any use of this value will cause an error
+  --> $DIR/const_panic_libcore_main.rs:20:1
    |
 LL | const Z: () = panic!("cheese");
    | ^^^^^^^^^^^^^^----------------^
@@ -9,8 +9,8 @@ LL | const Z: () = panic!("cheese");
    = note: #[deny(const_err)] on by default
    = 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: this constant cannot be used
-  --> $DIR/const_panic_libcore_main.rs:22:1
+error: any use of this value will cause an error
+  --> $DIR/const_panic_libcore_main.rs:23:1
    |
 LL | const Y: () = unreachable!();
    | ^^^^^^^^^^^^^^--------------^
@@ -19,8 +19,8 @@ LL | const Y: () = unreachable!();
    |
    = 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: this constant cannot be used
-  --> $DIR/const_panic_libcore_main.rs:25:1
+error: any use of this value will cause an error
+  --> $DIR/const_panic_libcore_main.rs:26:1
    |
 LL | const X: () = unimplemented!();
    | ^^^^^^^^^^^^^^----------------^
diff --git a/src/test/ui/consts/const-eval/const_raw_ptr_ops.rs b/src/test/ui/consts/const-eval/const_raw_ptr_ops.rs
index 2aff6a7c55c..3cd2c04c9f1 100644
--- a/src/test/ui/consts/const-eval/const_raw_ptr_ops.rs
+++ b/src/test/ui/consts/const-eval/const_raw_ptr_ops.rs
@@ -13,15 +13,15 @@
 fn main() {}
 
 // unconst and bad, will thus error in miri
-const X: bool = &1 as *const i32 == &2 as *const i32; //~ ERROR cannot be used
+const X: bool = &1 as *const i32 == &2 as *const i32; //~ ERROR any use of this value will cause
 // unconst and fine
 const X2: bool = 42 as *const i32 == 43 as *const i32;
 // unconst and fine
 const Y: usize = 42usize as *const i32 as usize + 1;
 // unconst and bad, will thus error in miri
-const Y2: usize = &1 as *const i32 as usize + 1; //~ ERROR cannot be used
+const Y2: usize = &1 as *const i32 as usize + 1; //~ ERROR any use of this value will cause
 // unconst and fine
 const Z: i32 = unsafe { *(&1 as *const i32) };
 // unconst and bad, will thus error in miri
-const Z2: i32 = unsafe { *(42 as *const i32) }; //~ ERROR cannot be used
-const Z3: i32 = unsafe { *(44 as *const i32) }; //~ ERROR cannot be used
+const Z2: i32 = unsafe { *(42 as *const i32) }; //~ ERROR any use of this value will cause
+const Z3: i32 = unsafe { *(44 as *const i32) }; //~ ERROR any use of this value will cause
diff --git a/src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr b/src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr
index df1e6f8e4c4..72bbdeb0183 100644
--- a/src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr
+++ b/src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr
@@ -1,33 +1,33 @@
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/const_raw_ptr_ops.rs:16:1
    |
-LL | const X: bool = &1 as *const i32 == &2 as *const i32; //~ ERROR cannot be used
+LL | const X: bool = &1 as *const i32 == &2 as *const i32; //~ ERROR any use of this value will cause
    | ^^^^^^^^^^^^^^^^------------------------------------^
    |                 |
    |                 "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
    |
    = note: #[deny(const_err)] on by default
 
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/const_raw_ptr_ops.rs:22:1
    |
-LL | const Y2: usize = &1 as *const i32 as usize + 1; //~ ERROR cannot be used
+LL | const Y2: usize = &1 as *const i32 as usize + 1; //~ ERROR any use of this value will cause
    | ^^^^^^^^^^^^^^^^^^-----------------------------^
    |                   |
    |                   "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
 
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/const_raw_ptr_ops.rs:26:1
    |
-LL | const Z2: i32 = unsafe { *(42 as *const i32) }; //~ ERROR cannot be used
+LL | const Z2: i32 = unsafe { *(42 as *const i32) }; //~ ERROR any use of this value will cause
    | ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------^^^
    |                          |
    |                          a memory access tried to interpret some bytes as a pointer
 
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/const_raw_ptr_ops.rs:27:1
    |
-LL | const Z3: i32 = unsafe { *(44 as *const i32) }; //~ ERROR cannot be used
+LL | const Z3: i32 = unsafe { *(44 as *const i32) }; //~ ERROR any use of this value will cause
    | ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------^^^
    |                          |
    |                          a memory access tried to interpret some bytes as a pointer
diff --git a/src/test/ui/consts/const-eval/double_check2.stderr b/src/test/ui/consts/const-eval/double_check2.stderr
index 21025877340..9dd7570232d 100644
--- a/src/test/ui/consts/const-eval/double_check2.stderr
+++ b/src/test/ui/consts/const-eval/double_check2.stderr
@@ -1,4 +1,4 @@
-error[E0080]: this static likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/double_check2.rs:25:1
    |
 LL | / static FOO: (&Foo, &Bar) = unsafe {( //~ undefined behavior
diff --git a/src/test/ui/consts/const-eval/infinite_loop.rs b/src/test/ui/consts/const-eval/infinite_loop.rs
index a1f8ab7f878..d23b6250b4d 100644
--- a/src/test/ui/consts/const-eval/infinite_loop.rs
+++ b/src/test/ui/consts/const-eval/infinite_loop.rs
@@ -15,10 +15,10 @@ fn main() {
     // The value of `n` will loop indefinitely (4 - 2 - 1 - 4).
     let _ = [(); {
         //~^ WARNING Constant evaluating a complex constant, this might take some time
-        //~| ERROR could not evaluate repeat length
         let mut n = 113383; // #20 in https://oeis.org/A006884
         while n != 0 { //~ ERROR constant contains unimplemented expression type
             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
+            //~^ ERROR evaluation of constant value failed
         }
         n
     }];
diff --git a/src/test/ui/consts/const-eval/infinite_loop.stderr b/src/test/ui/consts/const-eval/infinite_loop.stderr
index f69aae29203..2ff80e5efb5 100644
--- a/src/test/ui/consts/const-eval/infinite_loop.stderr
+++ b/src/test/ui/consts/const-eval/infinite_loop.stderr
@@ -1,8 +1,9 @@
 error[E0019]: constant contains unimplemented expression type
-  --> $DIR/infinite_loop.rs:20:9
+  --> $DIR/infinite_loop.rs:19:9
    |
 LL | /         while n != 0 { //~ ERROR constant contains unimplemented expression type
 LL | |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
+LL | |             //~^ ERROR evaluation of constant value failed
 LL | |         }
    | |_________^
 
@@ -12,28 +13,18 @@ warning: Constant evaluating a complex constant, this might take some time
 LL |       let _ = [(); {
    |  __________________^
 LL | |         //~^ WARNING Constant evaluating a complex constant, this might take some time
-LL | |         //~| ERROR could not evaluate repeat length
 LL | |         let mut n = 113383; // #20 in https://oeis.org/A006884
+LL | |         while n != 0 { //~ ERROR constant contains unimplemented expression type
 ...  |
 LL | |         n
 LL | |     }];
    | |_____^
 
-error[E0080]: could not evaluate repeat length
-  --> $DIR/infinite_loop.rs:16:18
+error[E0080]: evaluation of constant value failed
+  --> $DIR/infinite_loop.rs:20:20
    |
-LL |       let _ = [(); {
-   |  __________________^
-LL | |         //~^ WARNING Constant evaluating a complex constant, this might take some time
-LL | |         //~| ERROR could not evaluate repeat length
-LL | |         let mut n = 113383; // #20 in https://oeis.org/A006884
-LL | |         while n != 0 { //~ ERROR constant contains unimplemented expression type
-LL | |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
-   | |                    ---------- duplicate interpreter state observed here, const evaluation will never terminate
-LL | |         }
-LL | |         n
-LL | |     }];
-   | |_____^
+LL |             n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
+   |                    ^^^^^^^^^^ duplicate interpreter state observed here, const evaluation will never terminate
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/consts/const-eval/issue-43197.nll.stderr b/src/test/ui/consts/const-eval/issue-43197.nll.stderr
new file mode 100644
index 00000000000..86a86922d3b
--- /dev/null
+++ b/src/test/ui/consts/const-eval/issue-43197.nll.stderr
@@ -0,0 +1,43 @@
+warning: any use of this value will cause an error
+  --> $DIR/issue-43197.rs:20:5
+   |
+LL |     const X: u32 = 0-1;
+   |     ^^^^^^^^^^^^^^^---^
+   |                    |
+   |                    attempt to subtract with overflow
+   |
+note: lint level defined here
+  --> $DIR/issue-43197.rs:11:9
+   |
+LL | #![warn(const_err)]
+   |         ^^^^^^^^^
+
+warning: any use of this value will cause an error
+  --> $DIR/issue-43197.rs:22:5
+   |
+LL |     const Y: u32 = foo(0-1);
+   |     ^^^^^^^^^^^^^^^^^^^---^^
+   |                        |
+   |                        attempt to subtract with overflow
+
+error[E0080]: evaluation of constant expression failed
+  --> $DIR/issue-43197.rs:24:14
+   |
+LL |     println!("{} {}", X, Y);
+   |              ^^^^^^^  - referenced constant has errors
+
+error[E0080]: evaluation of constant expression failed
+  --> $DIR/issue-43197.rs:24:26
+   |
+LL |     println!("{} {}", X, Y);
+   |                          ^ referenced constant has errors
+
+error[E0080]: evaluation of constant expression failed
+  --> $DIR/issue-43197.rs:24:23
+   |
+LL |     println!("{} {}", X, Y);
+   |                       ^ referenced constant has errors
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/issue-43197.rs b/src/test/ui/consts/const-eval/issue-43197.rs
index 6e60fd834d4..125b5e4d208 100644
--- a/src/test/ui/consts/const-eval/issue-43197.rs
+++ b/src/test/ui/consts/const-eval/issue-43197.rs
@@ -16,12 +16,10 @@ const fn foo(x: u32) -> u32 {
 
 fn main() {
     const X: u32 = 0-1;
-    //~^ WARN this constant cannot be used
+    //~^ WARN any use of this value will cause
     const Y: u32 = foo(0-1);
-    //~^ WARN this constant cannot be used
+    //~^ WARN any use of this value will cause
     println!("{} {}", X, Y);
-    //~^ ERROR erroneous constant used
-    //~| ERROR erroneous constant used
-    //~| ERROR E0080
-    //~| ERROR E0080
+    //~^ ERROR evaluation of constant expression failed
+    //~| ERROR evaluation of constant expression failed
 }
diff --git a/src/test/ui/consts/const-eval/issue-43197.stderr b/src/test/ui/consts/const-eval/issue-43197.stderr
index 6229790f8ad..95d43581830 100644
--- a/src/test/ui/consts/const-eval/issue-43197.stderr
+++ b/src/test/ui/consts/const-eval/issue-43197.stderr
@@ -1,5 +1,5 @@
-warning: this constant cannot be used
-  --> $DIR/issue-43197.rs:18:5
+warning: any use of this value will cause an error
+  --> $DIR/issue-43197.rs:20:5
    |
 LL |     const X: u32 = 0-1;
    |     ^^^^^^^^^^^^^^^---^
@@ -12,44 +12,26 @@ note: lint level defined here
 LL | #![warn(const_err)]
    |         ^^^^^^^^^
 
-warning: this constant cannot be used
-  --> $DIR/issue-43197.rs:20:5
+warning: any use of this value will cause an error
+  --> $DIR/issue-43197.rs:22:5
    |
 LL |     const Y: u32 = foo(0-1);
    |     ^^^^^^^^^^^^^^^^^^^---^^
    |                        |
    |                        attempt to subtract with overflow
 
-error[E0080]: referenced constant has errors
-  --> $DIR/issue-43197.rs:22:26
-   |
-LL |     const Y: u32 = foo(0-1);
-   |                        --- attempt to subtract with overflow
-LL |     //~^ WARN this constant cannot be used
-LL |     println!("{} {}", X, Y);
-   |                          ^
-
-error[E0080]: erroneous constant used
-  --> $DIR/issue-43197.rs:22:26
+error[E0080]: evaluation of constant expression failed
+  --> $DIR/issue-43197.rs:24:26
    |
 LL |     println!("{} {}", X, Y);
    |                          ^ referenced constant has errors
 
-error[E0080]: referenced constant has errors
-  --> $DIR/issue-43197.rs:22:23
-   |
-LL |     const X: u32 = 0-1;
-   |                    --- attempt to subtract with overflow
-...
-LL |     println!("{} {}", X, Y);
-   |                       ^
-
-error[E0080]: erroneous constant used
-  --> $DIR/issue-43197.rs:22:23
+error[E0080]: evaluation of constant expression failed
+  --> $DIR/issue-43197.rs:24:23
    |
 LL |     println!("{} {}", X, Y);
    |                       ^ referenced constant has errors
 
-error: aborting due to 4 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/consts/const-eval/issue-44578.nll.stderr b/src/test/ui/consts/const-eval/issue-44578.nll.stderr
new file mode 100644
index 00000000000..71e06e36361
--- /dev/null
+++ b/src/test/ui/consts/const-eval/issue-44578.nll.stderr
@@ -0,0 +1,15 @@
+error[E0080]: evaluation of constant expression failed
+  --> $DIR/issue-44578.rs:35:14
+   |
+LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
+   |              ^^^^  -------------------------- referenced constant has errors
+
+error[E0080]: evaluation of constant expression failed
+  --> $DIR/issue-44578.rs:35:20
+   |
+LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
+   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/issue-44578.rs b/src/test/ui/consts/const-eval/issue-44578.rs
index 59ac4ab311c..9bd84b91d7f 100644
--- a/src/test/ui/consts/const-eval/issue-44578.rs
+++ b/src/test/ui/consts/const-eval/issue-44578.rs
@@ -33,6 +33,5 @@ impl Foo for u16 {
 
 fn main() {
     println!("{}", <Bar<u16, u8> as Foo>::AMT);
-    //~^ ERROR erroneous constant used
-    //~| ERROR E0080
+    //~^ ERROR E0080
 }
diff --git a/src/test/ui/consts/const-eval/issue-44578.stderr b/src/test/ui/consts/const-eval/issue-44578.stderr
index 06174f37dca..570a8960164 100644
--- a/src/test/ui/consts/const-eval/issue-44578.stderr
+++ b/src/test/ui/consts/const-eval/issue-44578.stderr
@@ -1,18 +1,9 @@
-error[E0080]: referenced constant has errors
-  --> $DIR/issue-44578.rs:35:20
-   |
-LL |     const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];
-   |                        ------------------------------------ index out of bounds: the len is 1 but the index is 1
-...
-LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0080]: erroneous constant used
+error[E0080]: evaluation of constant expression failed
   --> $DIR/issue-44578.rs:35:20
    |
 LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/issue-50814-2.rs b/src/test/ui/consts/const-eval/issue-50814-2.rs
index af627ee5fbe..9a59ffd65ac 100644
--- a/src/test/ui/consts/const-eval/issue-50814-2.rs
+++ b/src/test/ui/consts/const-eval/issue-50814-2.rs
@@ -19,12 +19,11 @@ trait Foo<T> {
 struct A<T>(T);
 
 impl<T: C> Foo<T> for A<T> {
-    const BAR: usize = [5, 6, 7][T::BOO];
+    const BAR: usize = [5, 6, 7][T::BOO]; //~ ERROR any use of this value will cause an error
 }
 
 fn foo<T: C>() -> &'static usize {
-    &<A<T> as Foo<T>>::BAR //~ ERROR erroneous constant used
-//~| ERROR E0080
+    &<A<T> as Foo<T>>::BAR //~ ERROR E0080
 }
 
 impl C for () {
diff --git a/src/test/ui/consts/const-eval/issue-50814-2.stderr b/src/test/ui/consts/const-eval/issue-50814-2.stderr
index 1e37e949812..b36b3cf526c 100644
--- a/src/test/ui/consts/const-eval/issue-50814-2.stderr
+++ b/src/test/ui/consts/const-eval/issue-50814-2.stderr
@@ -1,16 +1,17 @@
-error[E0080]: referenced constant has errors
-  --> $DIR/issue-50814-2.rs:26:5
+error: any use of this value will cause an error
+  --> $DIR/issue-50814-2.rs:22:5
+   |
+LL |     const BAR: usize = [5, 6, 7][T::BOO]; //~ ERROR any use of this value will cause an error
+   |     ^^^^^^^^^^^^^^^^^^^-----------------^
+   |                        |
+   |                        index out of bounds: the len is 3 but the index is 42
    |
-LL |     const BAR: usize = [5, 6, 7][T::BOO];
-   |                        ----------------- index out of bounds: the len is 3 but the index is 42
-...
-LL |     &<A<T> as Foo<T>>::BAR //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^^^^^^^^^^
+   = note: #[deny(const_err)] on by default
 
-error[E0080]: erroneous constant used
+error[E0080]: evaluation of constant expression failed
   --> $DIR/issue-50814-2.rs:26:5
    |
-LL |     &<A<T> as Foo<T>>::BAR //~ ERROR erroneous constant used
+LL |     &<A<T> as Foo<T>>::BAR //~ ERROR E0080
    |     ^---------------------
    |      |
    |      referenced constant has errors
diff --git a/src/test/ui/consts/const-eval/issue-50814.rs b/src/test/ui/consts/const-eval/issue-50814.rs
index 8f2752453b5..3c7f1826449 100644
--- a/src/test/ui/consts/const-eval/issue-50814.rs
+++ b/src/test/ui/consts/const-eval/issue-50814.rs
@@ -20,12 +20,11 @@ impl Unsigned for U8 {
 struct Sum<A,B>(A,B);
 
 impl<A: Unsigned, B: Unsigned> Unsigned for Sum<A,B> {
-    const MAX: u8 = A::MAX + B::MAX;
+    const MAX: u8 = A::MAX + B::MAX; //~ ERROR any use of this value will cause an error
 }
 
 fn foo<T>(_: T) -> &'static u8 {
-    &Sum::<U8,U8>::MAX //~ ERROR erroneous constant used
-//~| ERROR E0080
+    &Sum::<U8,U8>::MAX //~ ERROR E0080
 }
 
 fn main() {
diff --git a/src/test/ui/consts/const-eval/issue-50814.stderr b/src/test/ui/consts/const-eval/issue-50814.stderr
index 16160207c57..ebd0e34ab7e 100644
--- a/src/test/ui/consts/const-eval/issue-50814.stderr
+++ b/src/test/ui/consts/const-eval/issue-50814.stderr
@@ -1,16 +1,17 @@
-error[E0080]: referenced constant has errors
-  --> $DIR/issue-50814.rs:27:5
+error: any use of this value will cause an error
+  --> $DIR/issue-50814.rs:23:5
+   |
+LL |     const MAX: u8 = A::MAX + B::MAX; //~ ERROR any use of this value will cause an error
+   |     ^^^^^^^^^^^^^^^^---------------^
+   |                     |
+   |                     attempt to add with overflow
    |
-LL |     const MAX: u8 = A::MAX + B::MAX;
-   |                     --------------- attempt to add with overflow
-...
-LL |     &Sum::<U8,U8>::MAX //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^^^^^^
+   = note: #[deny(const_err)] on by default
 
-error[E0080]: erroneous constant used
+error[E0080]: evaluation of constant expression failed
   --> $DIR/issue-50814.rs:27:5
    |
-LL |     &Sum::<U8,U8>::MAX //~ ERROR erroneous constant used
+LL |     &Sum::<U8,U8>::MAX //~ ERROR E0080
    |     ^-----------------
    |      |
    |      referenced constant has errors
diff --git a/src/test/ui/consts/const-eval/issue-52443.stderr b/src/test/ui/consts/const-eval/issue-52443.stderr
new file mode 100644
index 00000000000..807a70dd201
--- /dev/null
+++ b/src/test/ui/consts/const-eval/issue-52443.stderr
@@ -0,0 +1,49 @@
+error[E0308]: mismatched types
+  --> $DIR/issue-52443.rs:12:10
+   |
+LL |     [(); & { loop { continue } } ]; //~ ERROR mismatched types
+   |          ^^^^^^^^^^^^^^^^^^^^^^^
+   |          |
+   |          expected usize, found reference
+   |          help: consider removing the borrow: `{ loop { continue } }`
+   |
+   = note: expected type `usize`
+              found type `&_`
+
+error[E0308]: mismatched types
+  --> $DIR/issue-52443.rs:13:17
+   |
+LL |     [(); loop { break }]; //~ ERROR mismatched types
+   |                 ^^^^^ expected (), found usize
+   |
+   = note: expected type `()`
+              found type `usize`
+
+error[E0019]: constant contains unimplemented expression type
+  --> $DIR/issue-52443.rs:14:11
+   |
+LL |     [(); {while true {break}; 0}]; //~ ERROR constant contains unimplemented expression type
+   |           ^^^^^^^^^^^^^^^^^^
+
+error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
+  --> $DIR/issue-52443.rs:15:21
+   |
+LL |     [(); { for _ in 0usize.. {}; 0}]; //~ ERROR calls in constants are limited to constant functions
+   |                     ^^^^^^^^
+
+error[E0019]: constant contains unimplemented expression type
+  --> $DIR/issue-52443.rs:15:21
+   |
+LL |     [(); { for _ in 0usize.. {}; 0}]; //~ ERROR calls in constants are limited to constant functions
+   |                     ^^^^^^^^
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/issue-52443.rs:15:21
+   |
+LL |     [(); { for _ in 0usize.. {}; 0}]; //~ ERROR calls in constants are limited to constant functions
+   |                     ^^^^^^^^ calling non-const fn `<I as std::iter::IntoIterator><std::ops::RangeFrom<usize>>::into_iter`
+
+error: aborting due to 6 previous errors
+
+Some errors occurred: E0015, E0019, E0080, E0308.
+For more information about an error, try `rustc --explain E0015`.
diff --git a/src/test/ui/consts/const-eval/match-test-ptr-null.rs b/src/test/ui/consts/const-eval/match-test-ptr-null.rs
index 81fcd23fb78..1a3164b0b03 100644
--- a/src/test/ui/consts/const-eval/match-test-ptr-null.rs
+++ b/src/test/ui/consts/const-eval/match-test-ptr-null.rs
@@ -12,10 +12,11 @@ fn main() {
     // Make sure match uses the usual pointer comparison code path -- i.e., it should complain
     // that pointer comparison is disallowed, not that parts of a pointer are accessed as raw
     // bytes.
-    let _: [u8; 0] = [4; { //~ ERROR could not evaluate repeat length
+    let _: [u8; 0] = [4; {
         match &1 as *const i32 as usize { //~ ERROR casting pointers to integers in constants
             0 => 42, //~ ERROR constant contains unimplemented expression type
             //~^ NOTE "pointer arithmetic or comparison" needs an rfc before being allowed
+            //~| ERROR evaluation of constant value failed
             n => n,
         }
     }];
diff --git a/src/test/ui/consts/const-eval/match-test-ptr-null.stderr b/src/test/ui/consts/const-eval/match-test-ptr-null.stderr
index 26577948fae..86812b6c493 100644
--- a/src/test/ui/consts/const-eval/match-test-ptr-null.stderr
+++ b/src/test/ui/consts/const-eval/match-test-ptr-null.stderr
@@ -12,19 +12,11 @@ error[E0019]: constant contains unimplemented expression type
 LL |             0 => 42, //~ ERROR constant contains unimplemented expression type
    |             ^
 
-error[E0080]: could not evaluate repeat length
-  --> $DIR/match-test-ptr-null.rs:15:26
+error[E0080]: evaluation of constant value failed
+  --> $DIR/match-test-ptr-null.rs:17:13
    |
-LL |       let _: [u8; 0] = [4; { //~ ERROR could not evaluate repeat length
-   |  __________________________^
-LL | |         match &1 as *const i32 as usize { //~ ERROR casting pointers to integers in constants
-LL | |             0 => 42, //~ ERROR constant contains unimplemented expression type
-   | |             - "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
-LL | |             //~^ NOTE "pointer arithmetic or comparison" needs an rfc before being allowed
-LL | |             n => n,
-LL | |         }
-LL | |     }];
-   | |_____^
+LL |             0 => 42, //~ ERROR constant contains unimplemented expression type
+   |             ^ "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs b/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs
index 9b03ddd1891..aa6cd888018 100644
--- a/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs
@@ -10,7 +10,7 @@
 
 #![feature(const_fn, const_fn_union)]
 
-#![deny(const_err)]
+#![allow(const_err)]
 
 union Bar {
     a: &'static u8,
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs
new file mode 100644
index 00000000000..9f19e68f2a8
--- /dev/null
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs
@@ -0,0 +1,36 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(const_fn, const_fn_union)]
+
+#![deny(const_err)]
+
+union Bar {
+    a: &'static u8,
+    b: usize,
+}
+
+const fn bar() -> u8 {
+    unsafe {
+        // this will error as long as this test
+        // is run on a system whose pointers need more
+        // than 8 bits
+        Bar { a: &42 }.b as u8
+    }
+}
+
+fn main() {
+    // FIXME(oli-obk): this should panic at runtime
+    // this will actually compile, but then
+    // abort at runtime (not panic, hard abort).
+    let x: &'static u8 = &(bar() + 1);
+    let y = *x;
+    unreachable!();
+}
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr
new file mode 100644
index 00000000000..3eeacbf842a
--- /dev/null
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr
@@ -0,0 +1,19 @@
+error: reaching this expression at runtime will panic or abort
+  --> $DIR/promoted_const_fn_fail_deny_const_err.rs:33:26
+   |
+LL |         Bar { a: &42 }.b as u8
+   |         ---------------------- a raw memory access tried to access part of a pointer value as raw bytes
+...
+LL |     let x: &'static u8 = &(bar() + 1);
+   |                          ^^-----^^^^^
+   |                            |
+   |                            inside call to `bar`
+   |
+note: lint level defined here
+  --> $DIR/promoted_const_fn_fail_deny_const_err.rs:13:9
+   |
+LL | #![deny(const_err)]
+   |         ^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/consts/const-eval/promoted_errors.stderr b/src/test/ui/consts/const-eval/promoted_errors.stderr
index 85b5696be94..26499fcb9b5 100644
--- a/src/test/ui/consts/const-eval/promoted_errors.stderr
+++ b/src/test/ui/consts/const-eval/promoted_errors.stderr
@@ -46,3 +46,15 @@ warning: this expression will panic at runtime
 LL |     let _x = 1/(false as u32);
    |              ^^^^^^^^^^^^^^^^ attempt to divide by zero
 
+warning: reaching this expression at runtime will panic or abort
+  --> $DIR/promoted_errors.rs:24:20
+   |
+LL |     println!("{}", 1/(false as u32));
+   |                    ^^^^^^^^^^^^^^^^ attempt to divide by zero
+
+warning: reaching this expression at runtime will panic or abort
+  --> $DIR/promoted_errors.rs:19:20
+   |
+LL |     println!("{}", 1/(1-1));
+   |                    ^^^^^^^ attempt to divide by zero
+
diff --git a/src/test/ui/consts/const-eval/pub_const_err.rs b/src/test/ui/consts/const-eval/pub_const_err.rs
index b7cfa949bac..48c172b5e31 100644
--- a/src/test/ui/consts/const-eval/pub_const_err.rs
+++ b/src/test/ui/consts/const-eval/pub_const_err.rs
@@ -14,7 +14,7 @@
 #![crate_type = "lib"]
 
 pub const Z: u32 = 0 - 1;
-//~^ WARN this constant cannot be used
+//~^ WARN any use of this value will cause an error
 
 pub type Foo = [i32; 0 - 1];
 //~^ WARN attempt to subtract with overflow
diff --git a/src/test/ui/consts/const-eval/pub_const_err.stderr b/src/test/ui/consts/const-eval/pub_const_err.stderr
index fa3a79a5f17..2194180c2ef 100644
--- a/src/test/ui/consts/const-eval/pub_const_err.stderr
+++ b/src/test/ui/consts/const-eval/pub_const_err.stderr
@@ -1,4 +1,4 @@
-warning: this constant cannot be used
+warning: any use of this value will cause an error
   --> $DIR/pub_const_err.rs:16:1
    |
 LL | pub const Z: u32 = 0 - 1;
@@ -12,15 +12,3 @@ note: lint level defined here
 LL | #![warn(const_err)]
    |         ^^^^^^^^^
 
-warning: attempt to subtract with overflow
-  --> $DIR/pub_const_err.rs:19:22
-   |
-LL | pub type Foo = [i32; 0 - 1];
-   |                      ^^^^^
-
-warning: this array length cannot be used
-  --> $DIR/pub_const_err.rs:19:22
-   |
-LL | pub type Foo = [i32; 0 - 1];
-   |                      ^^^^^ attempt to subtract with overflow
-
diff --git a/src/test/ui/consts/const-eval/pub_const_err_bin.rs b/src/test/ui/consts/const-eval/pub_const_err_bin.rs
index bafa5b2f4da..849d40cf107 100644
--- a/src/test/ui/consts/const-eval/pub_const_err_bin.rs
+++ b/src/test/ui/consts/const-eval/pub_const_err_bin.rs
@@ -12,7 +12,7 @@
 #![warn(const_err)]
 
 pub const Z: u32 = 0 - 1;
-//~^ WARN this constant cannot be used
+//~^ WARN any use of this value will cause an error
 
 pub type Foo = [i32; 0 - 1];
 //~^ WARN attempt to subtract with overflow
diff --git a/src/test/ui/consts/const-eval/pub_const_err_bin.stderr b/src/test/ui/consts/const-eval/pub_const_err_bin.stderr
index 73229c60d14..60834e00650 100644
--- a/src/test/ui/consts/const-eval/pub_const_err_bin.stderr
+++ b/src/test/ui/consts/const-eval/pub_const_err_bin.stderr
@@ -1,4 +1,4 @@
-warning: this constant cannot be used
+warning: any use of this value will cause an error
   --> $DIR/pub_const_err_bin.rs:14:1
    |
 LL | pub const Z: u32 = 0 - 1;
@@ -12,15 +12,3 @@ note: lint level defined here
 LL | #![warn(const_err)]
    |         ^^^^^^^^^
 
-warning: attempt to subtract with overflow
-  --> $DIR/pub_const_err_bin.rs:17:22
-   |
-LL | pub type Foo = [i32; 0 - 1];
-   |                      ^^^^^
-
-warning: this array length cannot be used
-  --> $DIR/pub_const_err_bin.rs:17:22
-   |
-LL | pub type Foo = [i32; 0 - 1];
-   |                      ^^^^^ attempt to subtract with overflow
-
diff --git a/src/test/ui/consts/const-eval/shift_overflow.stderr b/src/test/ui/consts/const-eval/shift_overflow.stderr
index 00a748249ea..f1d30394d38 100644
--- a/src/test/ui/consts/const-eval/shift_overflow.stderr
+++ b/src/test/ui/consts/const-eval/shift_overflow.stderr
@@ -1,4 +1,4 @@
-error[E0080]: could not evaluate enum discriminant
+error[E0080]: evaluation of constant value failed
   --> $DIR/shift_overflow.rs:13:9
    |
 LL |     X = 1 << ((u32::max_value() as u64) + 1), //~ ERROR E0080
diff --git a/src/test/ui/consts/const-eval/ub-enum.rs b/src/test/ui/consts/const-eval/ub-enum.rs
index bcb71af54af..2f7a5dda9ff 100644
--- a/src/test/ui/consts/const-eval/ub-enum.rs
+++ b/src/test/ui/consts/const-eval/ub-enum.rs
@@ -20,7 +20,7 @@ union TransmuteEnum {
 
 // A pointer is guaranteed non-null
 const BAD_ENUM: Enum = unsafe { TransmuteEnum { a: &1 }.b };
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR is undefined behavior
 
 // Invalid enum discriminant
 #[repr(usize)]
@@ -33,7 +33,7 @@ union TransmuteEnum2 {
     b: Enum2,
 }
 const BAD_ENUM2 : Enum2 = unsafe { TransmuteEnum2 { a: 0 }.b };
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR is undefined behavior
 
 // Invalid enum field content (mostly to test printing of apths for enum tuple
 // variants and tuples).
@@ -43,7 +43,7 @@ union TransmuteChar {
 }
 // Need to create something which does not clash with enum layout optimizations.
 const BAD_ENUM_CHAR : Option<(char, char)> = Some(('x', unsafe { TransmuteChar { a: !0 }.b }));
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR is undefined behavior
 
 fn main() {
 }
diff --git a/src/test/ui/consts/const-eval/ub-enum.stderr b/src/test/ui/consts/const-eval/ub-enum.stderr
index 243343c94b0..4cbaa2f3a90 100644
--- a/src/test/ui/consts/const-eval/ub-enum.stderr
+++ b/src/test/ui/consts/const-eval/ub-enum.stderr
@@ -1,4 +1,4 @@
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/ub-enum.rs:22:1
    |
 LL | const BAD_ENUM: Enum = unsafe { TransmuteEnum { a: &1 }.b };
@@ -6,7 +6,7 @@ LL | const BAD_ENUM: Enum = unsafe { TransmuteEnum { a: &1 }.b };
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/ub-enum.rs:35:1
    |
 LL | const BAD_ENUM2 : Enum2 = unsafe { TransmuteEnum2 { a: 0 }.b };
@@ -14,7 +14,7 @@ LL | const BAD_ENUM2 : Enum2 = unsafe { TransmuteEnum2 { a: 0 }.b };
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/ub-enum.rs:45:1
    |
 LL | const BAD_ENUM_CHAR : Option<(char, char)> = Some(('x', unsafe { TransmuteChar { a: !0 }.b }));
diff --git a/src/test/ui/consts/const-eval/union-const-eval-field.rs b/src/test/ui/consts/const-eval/union-const-eval-field.rs
index 5723f4a4159..40d1f97a807 100644
--- a/src/test/ui/consts/const-eval/union-const-eval-field.rs
+++ b/src/test/ui/consts/const-eval/union-const-eval-field.rs
@@ -34,12 +34,15 @@ const fn read_field2() -> Field2 {
 }
 
 const fn read_field3() -> Field3 {
-    const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR cannot be used
+    const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR any use of this value
+    //~^ ERROR any use of this value
     FIELD3
+    //~^ erroneous constant used
 }
 
 fn main() {
     assert_eq!(read_field1(), FLOAT1_AS_I32);
     assert_eq!(read_field2(), 1.0);
     assert_eq!(read_field3(), unsafe { UNION.field3 });
+    //~^ ERROR evaluation of constant expression failed
 }
diff --git a/src/test/ui/consts/const-eval/union-const-eval-field.stderr b/src/test/ui/consts/const-eval/union-const-eval-field.stderr
index 811450c8cba..39320791a3f 100644
--- a/src/test/ui/consts/const-eval/union-const-eval-field.stderr
+++ b/src/test/ui/consts/const-eval/union-const-eval-field.stderr
@@ -1,10 +1,36 @@
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/union-const-eval-field.rs:37:5
    |
-LL |     const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR cannot be used
+LL |     const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR any use of this value
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to read undefined bytes
    |
    = note: #[deny(const_err)] on by default
 
-error: aborting due to previous error
+error: any use of this value will cause an error
+  --> $DIR/union-const-eval-field.rs:37:5
+   |
+LL |     const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR any use of this value
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to read undefined bytes
+
+error[E0080]: erroneous constant used
+  --> $DIR/union-const-eval-field.rs:39:5
+   |
+LL |     FIELD3
+   |     ^^^^^^ referenced constant has errors
+
+error[E0080]: evaluation of constant expression failed
+  --> $DIR/union-const-eval-field.rs:46:5
+   |
+LL |     FIELD3
+   |     ------ referenced constant has errors
+...
+LL |     assert_eq!(read_field3(), unsafe { UNION.field3 });
+   |     ^^^^^^^^^^^-------------^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                |
+   |                inside call to `read_field3`
+   |
+   = 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: aborting due to 4 previous errors
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/union-ice.rs b/src/test/ui/consts/const-eval/union-ice.rs
index 5d50004e554..5a8ea711d86 100644
--- a/src/test/ui/consts/const-eval/union-ice.rs
+++ b/src/test/ui/consts/const-eval/union-ice.rs
@@ -20,9 +20,9 @@ union DummyUnion {
 
 const UNION: DummyUnion = DummyUnion { field1: 1065353216 };
 
-const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR this constant cannot be used
+const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR will cause an error
 
-const FIELD_PATH: Struct = Struct { //~ ERROR this constant likely exhibits undefined behavior
+const FIELD_PATH: Struct = Struct { //~ ERROR any use of this value will cause an error
     a: 42,
     b: unsafe { UNION.field3 },
 };
@@ -32,7 +32,7 @@ struct Struct {
     b: Field3,
 }
 
-const FIELD_PATH2: Struct2 = Struct2 { //~ ERROR this constant likely exhibits undefined behavior
+const FIELD_PATH2: Struct2 = Struct2 { //~ ERROR it is undefined behavior to use this value
     b: [
         21,
         unsafe { UNION.field3 },
diff --git a/src/test/ui/consts/const-eval/union-ice.stderr b/src/test/ui/consts/const-eval/union-ice.stderr
index 4484dd6a147..7f5cb731c8e 100644
--- a/src/test/ui/consts/const-eval/union-ice.stderr
+++ b/src/test/ui/consts/const-eval/union-ice.stderr
@@ -1,15 +1,15 @@
-error: this constant cannot be used
+error: any use of this value will cause an error
   --> $DIR/union-ice.rs:23:1
    |
-LL | const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR this constant cannot be used
+LL | const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR will cause an error
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to read undefined bytes
    |
    = note: #[deny(const_err)] on by default
 
-error[E0080]: this constant likely exhibits undefined behavior
+error: any use of this value will cause an error
   --> $DIR/union-ice.rs:25:1
    |
-LL | / const FIELD_PATH: Struct = Struct { //~ ERROR this constant likely exhibits undefined behavior
+LL | / const FIELD_PATH: Struct = Struct { //~ ERROR any use of this value will cause an error
 LL | |     a: 42,
 LL | |     b: unsafe { UNION.field3 },
 LL | | };
@@ -17,10 +17,10 @@ LL | | };
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ice.rs:35:1
    |
-LL | / const FIELD_PATH2: Struct2 = Struct2 { //~ ERROR this constant likely exhibits undefined behavior
+LL | / const FIELD_PATH2: Struct2 = Struct2 { //~ ERROR it is undefined behavior to use this value
 LL | |     b: [
 LL | |         21,
 LL | |         unsafe { UNION.field3 },
diff --git a/src/test/ui/consts/const-eval/union-ub-fat-ptr.rs b/src/test/ui/consts/const-eval/union-ub-fat-ptr.rs
index 0c42d28eb00..479cee92b94 100644
--- a/src/test/ui/consts/const-eval/union-ub-fat-ptr.rs
+++ b/src/test/ui/consts/const-eval/union-ub-fat-ptr.rs
@@ -85,55 +85,56 @@ type MySliceBool = MySlice<[bool]>;
 const A: &str = unsafe { SliceTransmute { repr: SliceRepr { ptr: &42, len: 1 } }.str};
 // bad str
 const B: &str = unsafe { SliceTransmute { repr: SliceRepr { ptr: &42, len: 999 } }.str};
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 // bad str
 const C: &str = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.str};
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 // bad str in user-defined unsized type
 const C2: &MyStr = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.my_str};
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 
 // OK
 const A2: &[u8] = unsafe { SliceTransmute { repr: SliceRepr { ptr: &42, len: 1 } }.slice};
 // bad slice
 const B2: &[u8] = unsafe { SliceTransmute { repr: SliceRepr { ptr: &42, len: 999 } }.slice};
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 // bad slice
 const C3: &[u8] = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.slice};
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 
 // bad trait object
 const D: &Trait = unsafe { DynTransmute { repr: DynRepr { ptr: &92, vtable: &3 } }.rust};
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 // bad trait object
 const E: &Trait = unsafe { DynTransmute { repr2: DynRepr2 { ptr: &92, vtable: &3 } }.rust};
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 // bad trait object
 const F: &Trait = unsafe { DynTransmute { bad: BadDynRepr { ptr: &92, vtable: 3 } }.rust};
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 
 // bad data *inside* the trait object
 const G: &Trait = &unsafe { BoolTransmute { val: 3 }.bl };
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
+
 // bad data *inside* the slice
 const H: &[bool] = &[unsafe { BoolTransmute { val: 3 }.bl }];
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 
 // good MySliceBool
 const I1: &MySliceBool = &MySlice(true, [false]);
 // bad: sized field is not okay
 const I2: &MySliceBool = &MySlice(unsafe { BoolTransmute { val: 3 }.bl }, [false]);
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 // bad: unsized part is not okay
 const I3: &MySliceBool = &MySlice(true, [unsafe { BoolTransmute { val: 3 }.bl }]);
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 
 // invalid UTF-8
 const J1: &str = unsafe { SliceTransmute { slice: &[0xFF] }.str };
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 // invalid UTF-8 in user-defined str-like
 const J2: &MyStr = unsafe { SliceTransmute { slice: &[0xFF] }.my_str };
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 
 fn main() {
 }
diff --git a/src/test/ui/consts/const-eval/union-ub-fat-ptr.stderr b/src/test/ui/consts/const-eval/union-ub-fat-ptr.stderr
index c4632ffe309..b61ea9ca6f9 100644
--- a/src/test/ui/consts/const-eval/union-ub-fat-ptr.stderr
+++ b/src/test/ui/consts/const-eval/union-ub-fat-ptr.stderr
@@ -1,4 +1,4 @@
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ub-fat-ptr.rs:87:1
    |
 LL | const B: &str = unsafe { SliceTransmute { repr: SliceRepr { ptr: &42, len: 999 } }.str};
@@ -6,7 +6,7 @@ LL | const B: &str = unsafe { SliceTransmute { repr: SliceRepr { ptr: &42, len:
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ub-fat-ptr.rs:90:1
    |
 LL | const C: &str = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.str};
@@ -14,7 +14,7 @@ LL | const C: &str = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ub-fat-ptr.rs:93:1
    |
 LL | const C2: &MyStr = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.my_str};
@@ -22,7 +22,7 @@ LL | const C2: &MyStr = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42,
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ub-fat-ptr.rs:99:1
    |
 LL | const B2: &[u8] = unsafe { SliceTransmute { repr: SliceRepr { ptr: &42, len: 999 } }.slice};
@@ -30,7 +30,7 @@ LL | const B2: &[u8] = unsafe { SliceTransmute { repr: SliceRepr { ptr: &42, len
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ub-fat-ptr.rs:102:1
    |
 LL | const C3: &[u8] = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.slice};
@@ -38,7 +38,7 @@ LL | const C3: &[u8] = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, l
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ub-fat-ptr.rs:106:1
    |
 LL | const D: &Trait = unsafe { DynTransmute { repr: DynRepr { ptr: &92, vtable: &3 } }.rust};
@@ -46,7 +46,7 @@ LL | const D: &Trait = unsafe { DynTransmute { repr: DynRepr { ptr: &92, vtable:
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ub-fat-ptr.rs:109:1
    |
 LL | const E: &Trait = unsafe { DynTransmute { repr2: DynRepr2 { ptr: &92, vtable: &3 } }.rust};
@@ -54,7 +54,7 @@ LL | const E: &Trait = unsafe { DynTransmute { repr2: DynRepr2 { ptr: &92, vtabl
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ub-fat-ptr.rs:112:1
    |
 LL | const F: &Trait = unsafe { DynTransmute { bad: BadDynRepr { ptr: &92, vtable: 3 } }.rust};
@@ -62,7 +62,7 @@ LL | const F: &Trait = unsafe { DynTransmute { bad: BadDynRepr { ptr: &92, vtabl
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ub-fat-ptr.rs:116:1
    |
 LL | const G: &Trait = &unsafe { BoolTransmute { val: 3 }.bl };
@@ -70,40 +70,40 @@ LL | const G: &Trait = &unsafe { BoolTransmute { val: 3 }.bl };
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
-  --> $DIR/union-ub-fat-ptr.rs:119:1
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/union-ub-fat-ptr.rs:120:1
    |
 LL | const H: &[bool] = &[unsafe { BoolTransmute { val: 3 }.bl }];
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 3 at .<deref>[0], but expected something in the range 0..=1
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
-  --> $DIR/union-ub-fat-ptr.rs:125:1
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/union-ub-fat-ptr.rs:126:1
    |
 LL | const I2: &MySliceBool = &MySlice(unsafe { BoolTransmute { val: 3 }.bl }, [false]);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 3 at .<deref>.0, but expected something in the range 0..=1
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
-  --> $DIR/union-ub-fat-ptr.rs:128:1
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/union-ub-fat-ptr.rs:129:1
    |
 LL | const I3: &MySliceBool = &MySlice(true, [unsafe { BoolTransmute { val: 3 }.bl }]);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 3 at .<deref>.1[0], but expected something in the range 0..=1
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
-  --> $DIR/union-ub-fat-ptr.rs:132:1
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/union-ub-fat-ptr.rs:133:1
    |
 LL | const J1: &str = unsafe { SliceTransmute { slice: &[0xFF] }.str };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized or non-UTF-8 data in str at .<deref>
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
-error[E0080]: this constant likely exhibits undefined behavior
-  --> $DIR/union-ub-fat-ptr.rs:135:1
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/union-ub-fat-ptr.rs:136:1
    |
 LL | const J2: &MyStr = unsafe { SliceTransmute { slice: &[0xFF] }.my_str };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized or non-UTF-8 data in str at .<deref>.0
diff --git a/src/test/ui/consts/const-eval/union-ub.rs b/src/test/ui/consts/const-eval/union-ub.rs
index 86b3bdaa6b7..008f1f23648 100644
--- a/src/test/ui/consts/const-eval/union-ub.rs
+++ b/src/test/ui/consts/const-eval/union-ub.rs
@@ -34,7 +34,7 @@ union Bar {
 
 // the value is not valid for bools
 const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
-//~^ ERROR this constant likely exhibits undefined behavior
+//~^ ERROR it is undefined behavior to use this value
 
 // The value is not valid for any union variant, but that's fine
 // unions are just a convenient way to transmute bits around
diff --git a/src/test/ui/consts/const-eval/union-ub.stderr b/src/test/ui/consts/const-eval/union-ub.stderr
index 2a04dae337b..bb916ddbbcf 100644
--- a/src/test/ui/consts/const-eval/union-ub.stderr
+++ b/src/test/ui/consts/const-eval/union-ub.stderr
@@ -1,4 +1,4 @@
-error[E0080]: this constant likely exhibits undefined behavior
+error[E0080]: it is undefined behavior to use this value
   --> $DIR/union-ub.rs:36:1
    |
 LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};