summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2020-09-15 20:34:50 +0100
committervarkor <github@varkor.com>2020-09-26 13:34:49 +0100
commit8eb42ba0fbd0326a8ffbe6ec2ff0abffaffa1a8f (patch)
tree31e563a5873cceb9977c1a5efc12c4a985a3bb62 /src/test/ui/consts/const-eval
parent6f9a8a7f9b9732c55511d2a2a3914e8feafc7c52 (diff)
downloadrust-8eb42ba0fbd0326a8ffbe6ec2ff0abffaffa1a8f.tar.gz
rust-8eb42ba0fbd0326a8ffbe6ec2ff0abffaffa1a8f.zip
Make invalid integer operation messages consistent
Diffstat (limited to 'src/test/ui/consts/const-eval')
-rw-r--r--src/test/ui/consts/const-eval/conditional_array_execution.stderr2
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-3.stderr2
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-4.stderr2
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2.stderr16
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2b.stderr16
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2c.stderr16
-rw-r--r--src/test/ui/consts/const-eval/erroneous-const.stderr4
-rw-r--r--src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr2
-rw-r--r--src/test/ui/consts/const-eval/index_out_of_bounds.stderr2
-rw-r--r--src/test/ui/consts/const-eval/index_out_of_bounds_propagated.stderr2
-rw-r--r--src/test/ui/consts/const-eval/issue-43197.stderr4
-rw-r--r--src/test/ui/consts/const-eval/issue-50814-2.stderr2
-rw-r--r--src/test/ui/consts/const-eval/issue-50814.stderr2
-rw-r--r--src/test/ui/consts/const-eval/promoted_errors.noopt.stderr12
-rw-r--r--src/test/ui/consts/const-eval/promoted_errors.opt.stderr10
-rw-r--r--src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr12
-rw-r--r--src/test/ui/consts/const-eval/pub_const_err.stderr2
-rw-r--r--src/test/ui/consts/const-eval/pub_const_err_bin.stderr2
-rw-r--r--src/test/ui/consts/const-eval/shift_overflow.stderr2
-rw-r--r--src/test/ui/consts/const-eval/unused-broken-const.stderr2
20 files changed, 57 insertions, 57 deletions
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 62f339809e4..65dfbd8097e 100644
--- a/src/test/ui/consts/const-eval/conditional_array_execution.stderr
+++ b/src/test/ui/consts/const-eval/conditional_array_execution.stderr
@@ -4,7 +4,7 @@ warning: any use of this value will cause an error
 LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
    | ------------------^^^^^---------------------------
    |                   |
-   |                   attempt to compute `5_u32 - 6_u32` which would overflow
+   |                   attempt to compute `5_u32 - 6_u32`, which would overflow
    |
 note: the lint level is defined here
   --> $DIR/conditional_array_execution.rs:3:9
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 dd79cbd7e5f..0ae51786b36 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
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
   --> $DIR/const-eval-overflow-3.rs:20:11
    |
 LL |     = [0; (i8::MAX + 1) as usize];
-   |           ^^^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8` which would overflow
+   |           ^^^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow
 
 error: aborting due to previous error
 
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 30c52a82ea3..e548fc266c2 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
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
   --> $DIR/const-eval-overflow-4.rs:13:13
    |
 LL |     : [u32; (i8::MAX as i8 + 1i8) as usize]
-   |             ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8` which would overflow
+   |             ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow
 
 error: aborting due to previous error
 
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 2ad557a7113..51a810b8f3b 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2.stderr
@@ -4,7 +4,7 @@ error: any use of this value will cause an error
 LL | / const VALS_I8: (i8,) =
 LL | |     (
 LL | |      i8::MIN - 1,
-   | |      ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8` which would overflow
+   | |      ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8`, which would overflow
 LL | |      );
    | |_______-
    |
@@ -20,7 +20,7 @@ error: any use of this value will cause an error
 LL | / const VALS_I16: (i16,) =
 LL | |     (
 LL | |      i16::MIN - 1,
-   | |      ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16`, which would overflow
 LL | |      );
    | |_______-
 
@@ -30,7 +30,7 @@ error: any use of this value will cause an error
 LL | / const VALS_I32: (i32,) =
 LL | |     (
 LL | |      i32::MIN - 1,
-   | |      ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32`, which would overflow
 LL | |      );
    | |_______-
 
@@ -40,7 +40,7 @@ error: any use of this value will cause an error
 LL | / const VALS_I64: (i64,) =
 LL | |     (
 LL | |      i64::MIN - 1,
-   | |      ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64`, which would overflow
 LL | |      );
    | |_______-
 
@@ -50,7 +50,7 @@ error: any use of this value will cause an error
 LL | / const VALS_U8: (u8,) =
 LL | |     (
 LL | |      u8::MIN - 1,
-   | |      ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8` which would overflow
+   | |      ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8`, which would overflow
 LL | |      );
    | |_______-
 
@@ -59,7 +59,7 @@ error: any use of this value will cause an error
    |
 LL | / const VALS_U16: (u16,) = (
 LL | |      u16::MIN - 1,
-   | |      ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16`, which would overflow
 LL | |      );
    | |_______-
 
@@ -68,7 +68,7 @@ error: any use of this value will cause an error
    |
 LL | / const VALS_U32: (u32,) = (
 LL | |      u32::MIN - 1,
-   | |      ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
 LL | |      );
    | |_______-
 
@@ -78,7 +78,7 @@ error: any use of this value will cause an error
 LL | / const VALS_U64: (u64,) =
 LL | |     (
 LL | |      u64::MIN - 1,
-   | |      ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64`, which would overflow
 LL | |      );
    | |_______-
 
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 fce616b296c..eec440fcb76 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr
@@ -4,7 +4,7 @@ error: any use of this value will cause an error
 LL | / const VALS_I8: (i8,) =
 LL | |     (
 LL | |      i8::MAX + 1,
-   | |      ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8` which would overflow
+   | |      ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow
 LL | |      );
    | |_______-
    |
@@ -20,7 +20,7 @@ error: any use of this value will cause an error
 LL | / const VALS_I16: (i16,) =
 LL | |     (
 LL | |      i16::MAX + 1,
-   | |      ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16`, which would overflow
 LL | |      );
    | |_______-
 
@@ -30,7 +30,7 @@ error: any use of this value will cause an error
 LL | / const VALS_I32: (i32,) =
 LL | |     (
 LL | |      i32::MAX + 1,
-   | |      ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
 LL | |      );
    | |_______-
 
@@ -40,7 +40,7 @@ error: any use of this value will cause an error
 LL | / const VALS_I64: (i64,) =
 LL | |     (
 LL | |      i64::MAX + 1,
-   | |      ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64`, which would overflow
 LL | |      );
    | |_______-
 
@@ -50,7 +50,7 @@ error: any use of this value will cause an error
 LL | / const VALS_U8: (u8,) =
 LL | |     (
 LL | |      u8::MAX + 1,
-   | |      ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8` which would overflow
+   | |      ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
 LL | |      );
    | |_______-
 
@@ -59,7 +59,7 @@ error: any use of this value will cause an error
    |
 LL | / const VALS_U16: (u16,) = (
 LL | |      u16::MAX + 1,
-   | |      ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16`, which would overflow
 LL | |      );
    | |_______-
 
@@ -68,7 +68,7 @@ error: any use of this value will cause an error
    |
 LL | / const VALS_U32: (u32,) = (
 LL | |      u32::MAX + 1,
-   | |      ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32`, which would overflow
 LL | |      );
    | |_______-
 
@@ -78,7 +78,7 @@ error: any use of this value will cause an error
 LL | / const VALS_U64: (u64,) =
 LL | |     (
 LL | |      u64::MAX + 1,
-   | |      ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow
 LL | |      );
    | |_______-
 
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 76201524d32..e44f94c2021 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr
@@ -4,7 +4,7 @@ error: any use of this value will cause an error
 LL | / const VALS_I8: (i8,) =
 LL | |     (
 LL | |      i8::MIN * 2,
-   | |      ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8` which would overflow
+   | |      ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8`, which would overflow
 LL | |      );
    | |_______-
    |
@@ -20,7 +20,7 @@ error: any use of this value will cause an error
 LL | / const VALS_I16: (i16,) =
 LL | |     (
 LL | |      i16::MIN * 2,
-   | |      ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16`, which would overflow
 LL | |      );
    | |_______-
 
@@ -30,7 +30,7 @@ error: any use of this value will cause an error
 LL | / const VALS_I32: (i32,) =
 LL | |     (
 LL | |      i32::MIN * 2,
-   | |      ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32`, which would overflow
 LL | |      );
    | |_______-
 
@@ -40,7 +40,7 @@ error: any use of this value will cause an error
 LL | / const VALS_I64: (i64,) =
 LL | |     (
 LL | |      i64::MIN * 2,
-   | |      ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64`, which would overflow
 LL | |      );
    | |_______-
 
@@ -50,7 +50,7 @@ error: any use of this value will cause an error
 LL | / const VALS_U8: (u8,) =
 LL | |     (
 LL | |      u8::MAX * 2,
-   | |      ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8` which would overflow
+   | |      ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8`, which would overflow
 LL | |      );
    | |_______-
 
@@ -59,7 +59,7 @@ error: any use of this value will cause an error
    |
 LL | / const VALS_U16: (u16,) = (
 LL | |      u16::MAX * 2,
-   | |      ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16`, which would overflow
 LL | |      );
    | |_______-
 
@@ -68,7 +68,7 @@ error: any use of this value will cause an error
    |
 LL | / const VALS_U32: (u32,) = (
 LL | |      u32::MAX * 2,
-   | |      ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32`, which would overflow
 LL | |      );
    | |_______-
 
@@ -78,7 +78,7 @@ error: any use of this value will cause an error
 LL | / const VALS_U64: (u64,) =
 LL | |     (
 LL | |      u64::MAX * 2,
-   | |      ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64` which would overflow
+   | |      ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64`, which would overflow
 LL | |      );
    | |_______-
 
diff --git a/src/test/ui/consts/const-eval/erroneous-const.stderr b/src/test/ui/consts/const-eval/erroneous-const.stderr
index f06e2c33fd0..7087a6f668c 100644
--- a/src/test/ui/consts/const-eval/erroneous-const.stderr
+++ b/src/test/ui/consts/const-eval/erroneous-const.stderr
@@ -2,7 +2,7 @@ warning: this operation will panic at runtime
   --> $DIR/erroneous-const.rs:6:22
    |
 LL |     const VOID: () = [()][2];
-   |                      ^^^^^^^ index out of bounds: the len is 1 but the index is 2
+   |                      ^^^^^^^ index out of bounds: the length is 1 but the index is 2
    |
 note: the lint level is defined here
   --> $DIR/erroneous-const.rs:2:20
@@ -16,7 +16,7 @@ warning: any use of this value will cause an error
 LL |     const VOID: () = [()][2];
    |     -----------------^^^^^^^-
    |                      |
-   |                      index out of bounds: the len is 1 but the index is 2
+   |                      index out of bounds: the length is 1 but the index is 2
    |
 note: the lint level is defined here
   --> $DIR/erroneous-const.rs:2:9
diff --git a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr
index 33e60dd7c91..8647da90a37 100644
--- a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr
+++ b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr
@@ -4,7 +4,7 @@ warning: any use of this value will cause an error
 LL |     const VOID: ! = { let x = 0 * std::mem::size_of::<T>(); [][x] };
    |     --------------------------------------------------------^^^^^---
    |                                                             |
-   |                                                             index out of bounds: the len is 0 but the index is 0
+   |                                                             index out of bounds: the length is 0 but the index is 0
    |
 note: the lint level is defined here
   --> $DIR/index-out-of-bounds-never-type.rs:4:9
diff --git a/src/test/ui/consts/const-eval/index_out_of_bounds.stderr b/src/test/ui/consts/const-eval/index_out_of_bounds.stderr
index 1b2974e4e3d..8bb3a0c67d6 100644
--- a/src/test/ui/consts/const-eval/index_out_of_bounds.stderr
+++ b/src/test/ui/consts/const-eval/index_out_of_bounds.stderr
@@ -2,7 +2,7 @@ error[E0080]: could not evaluate static initializer
   --> $DIR/index_out_of_bounds.rs:1:19
    |
 LL | static FOO: i32 = [][0];
-   |                   ^^^^^ index out of bounds: the len is 0 but the index is 0
+   |                   ^^^^^ index out of bounds: the length is 0 but the index is 0
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/consts/const-eval/index_out_of_bounds_propagated.stderr b/src/test/ui/consts/const-eval/index_out_of_bounds_propagated.stderr
index 4188efd021d..d247d691dbb 100644
--- a/src/test/ui/consts/const-eval/index_out_of_bounds_propagated.stderr
+++ b/src/test/ui/consts/const-eval/index_out_of_bounds_propagated.stderr
@@ -2,7 +2,7 @@ error: this operation will panic at runtime
   --> $DIR/index_out_of_bounds_propagated.rs:5:5
    |
 LL |     array[1];
-   |     ^^^^^^^^ index out of bounds: the len is 1 but the index is 1
+   |     ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
    |
    = note: `#[deny(unconditional_panic)]` on by default
 
diff --git a/src/test/ui/consts/const-eval/issue-43197.stderr b/src/test/ui/consts/const-eval/issue-43197.stderr
index b3e1f496ae3..27e067cedbb 100644
--- a/src/test/ui/consts/const-eval/issue-43197.stderr
+++ b/src/test/ui/consts/const-eval/issue-43197.stderr
@@ -4,7 +4,7 @@ warning: any use of this value will cause an error
 LL |     const X: u32 = 0 - 1;
    |     ---------------^^^^^-
    |                    |
-   |                    attempt to compute `0_u32 - 1_u32` which would overflow
+   |                    attempt to compute `0_u32 - 1_u32`, which would overflow
    |
 note: the lint level is defined here
   --> $DIR/issue-43197.rs:3:9
@@ -18,7 +18,7 @@ warning: any use of this value will cause an error
 LL |     const Y: u32 = foo(0 - 1);
    |     -------------------^^^^^--
    |                        |
-   |                        attempt to compute `0_u32 - 1_u32` which would overflow
+   |                        attempt to compute `0_u32 - 1_u32`, which would overflow
 
 error[E0080]: evaluation of constant expression failed
   --> $DIR/issue-43197.rs:14:23
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 e04bf03a20c..ca8885e9350 100644
--- a/src/test/ui/consts/const-eval/issue-50814-2.stderr
+++ b/src/test/ui/consts/const-eval/issue-50814-2.stderr
@@ -4,7 +4,7 @@ error: any use of this value will cause an error
 LL |     const BAR: usize = [5, 6, 7][T::BOO];
    |     -------------------^^^^^^^^^^^^^^^^^-
    |                        |
-   |                        index out of bounds: the len is 3 but the index is 42
+   |                        index out of bounds: the length is 3 but the index is 42
    |
    = note: `#[deny(const_err)]` on by default
 
diff --git a/src/test/ui/consts/const-eval/issue-50814.stderr b/src/test/ui/consts/const-eval/issue-50814.stderr
index 4be84f8d184..73271386276 100644
--- a/src/test/ui/consts/const-eval/issue-50814.stderr
+++ b/src/test/ui/consts/const-eval/issue-50814.stderr
@@ -4,7 +4,7 @@ error: any use of this value will cause an error
 LL |     const MAX: u8 = A::MAX + B::MAX;
    |     ----------------^^^^^^^^^^^^^^^-
    |                     |
-   |                     attempt to compute `u8::MAX + u8::MAX` which would overflow
+   |                     attempt to compute `u8::MAX + u8::MAX`, which would overflow
    |
    = note: `#[deny(const_err)]` on by default
 
diff --git a/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr b/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr
index 52313205dc8..ce83d8e9bb0 100644
--- a/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr
+++ b/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr
@@ -2,7 +2,7 @@ warning: this arithmetic operation will overflow
   --> $DIR/promoted_errors.rs:12:20
    |
 LL |     println!("{}", 0u32 - 1);
-   |                    ^^^^^^^^ attempt to compute `0_u32 - 1_u32` which would overflow
+   |                    ^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
    |
 note: the lint level is defined here
   --> $DIR/promoted_errors.rs:9:20
@@ -14,13 +14,13 @@ warning: this arithmetic operation will overflow
   --> $DIR/promoted_errors.rs:14:14
    |
 LL |     let _x = 0u32 - 1;
-   |              ^^^^^^^^ attempt to compute `0_u32 - 1_u32` which would overflow
+   |              ^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
 
 warning: this operation will panic at runtime
   --> $DIR/promoted_errors.rs:16:20
    |
 LL |     println!("{}", 1 / (1 - 1));
-   |                    ^^^^^^^^^^^ attempt to divide 1_i32 by zero
+   |                    ^^^^^^^^^^^ attempt to divide `1_i32` by zero
    |
 note: the lint level is defined here
   --> $DIR/promoted_errors.rs:9:41
@@ -50,13 +50,13 @@ warning: this operation will panic at runtime
   --> $DIR/promoted_errors.rs:20:14
    |
 LL |     let _x = 1 / (1 - 1);
-   |              ^^^^^^^^^^^ attempt to divide 1_i32 by zero
+   |              ^^^^^^^^^^^ attempt to divide `1_i32` by zero
 
 warning: this operation will panic at runtime
   --> $DIR/promoted_errors.rs:22:20
    |
 LL |     println!("{}", 1 / (false as u32));
-   |                    ^^^^^^^^^^^^^^^^^^ attempt to divide 1_u32 by zero
+   |                    ^^^^^^^^^^^^^^^^^^ attempt to divide `1_u32` by zero
 
 warning: reaching this expression at runtime will panic or abort
   --> $DIR/promoted_errors.rs:22:20
@@ -74,7 +74,7 @@ warning: this operation will panic at runtime
   --> $DIR/promoted_errors.rs:26:14
    |
 LL |     let _x = 1 / (false as u32);
-   |              ^^^^^^^^^^^^^^^^^^ attempt to divide 1_u32 by zero
+   |              ^^^^^^^^^^^^^^^^^^ attempt to divide `1_u32` by zero
 
 warning: 10 warnings emitted
 
diff --git a/src/test/ui/consts/const-eval/promoted_errors.opt.stderr b/src/test/ui/consts/const-eval/promoted_errors.opt.stderr
index b411bb2e7fe..2c66b175cfc 100644
--- a/src/test/ui/consts/const-eval/promoted_errors.opt.stderr
+++ b/src/test/ui/consts/const-eval/promoted_errors.opt.stderr
@@ -2,7 +2,7 @@ warning: this arithmetic operation will overflow
   --> $DIR/promoted_errors.rs:14:14
    |
 LL |     let _x = 0u32 - 1;
-   |              ^^^^^^^^ attempt to compute `0_u32 - 1_u32` which would overflow
+   |              ^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
    |
 note: the lint level is defined here
   --> $DIR/promoted_errors.rs:9:20
@@ -14,7 +14,7 @@ warning: this operation will panic at runtime
   --> $DIR/promoted_errors.rs:16:20
    |
 LL |     println!("{}", 1 / (1 - 1));
-   |                    ^^^^^^^^^^^ attempt to divide 1_i32 by zero
+   |                    ^^^^^^^^^^^ attempt to divide `1_i32` by zero
    |
 note: the lint level is defined here
   --> $DIR/promoted_errors.rs:9:41
@@ -44,13 +44,13 @@ warning: this operation will panic at runtime
   --> $DIR/promoted_errors.rs:20:14
    |
 LL |     let _x = 1 / (1 - 1);
-   |              ^^^^^^^^^^^ attempt to divide 1_i32 by zero
+   |              ^^^^^^^^^^^ attempt to divide `1_i32` by zero
 
 warning: this operation will panic at runtime
   --> $DIR/promoted_errors.rs:22:20
    |
 LL |     println!("{}", 1 / (false as u32));
-   |                    ^^^^^^^^^^^^^^^^^^ attempt to divide 1_u32 by zero
+   |                    ^^^^^^^^^^^^^^^^^^ attempt to divide `1_u32` by zero
 
 warning: reaching this expression at runtime will panic or abort
   --> $DIR/promoted_errors.rs:22:20
@@ -68,7 +68,7 @@ warning: this operation will panic at runtime
   --> $DIR/promoted_errors.rs:26:14
    |
 LL |     let _x = 1 / (false as u32);
-   |              ^^^^^^^^^^^^^^^^^^ attempt to divide 1_u32 by zero
+   |              ^^^^^^^^^^^^^^^^^^ attempt to divide `1_u32` by zero
 
 warning: 9 warnings emitted
 
diff --git a/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr b/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr
index 52313205dc8..ce83d8e9bb0 100644
--- a/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr
+++ b/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr
@@ -2,7 +2,7 @@ warning: this arithmetic operation will overflow
   --> $DIR/promoted_errors.rs:12:20
    |
 LL |     println!("{}", 0u32 - 1);
-   |                    ^^^^^^^^ attempt to compute `0_u32 - 1_u32` which would overflow
+   |                    ^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
    |
 note: the lint level is defined here
   --> $DIR/promoted_errors.rs:9:20
@@ -14,13 +14,13 @@ warning: this arithmetic operation will overflow
   --> $DIR/promoted_errors.rs:14:14
    |
 LL |     let _x = 0u32 - 1;
-   |              ^^^^^^^^ attempt to compute `0_u32 - 1_u32` which would overflow
+   |              ^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
 
 warning: this operation will panic at runtime
   --> $DIR/promoted_errors.rs:16:20
    |
 LL |     println!("{}", 1 / (1 - 1));
-   |                    ^^^^^^^^^^^ attempt to divide 1_i32 by zero
+   |                    ^^^^^^^^^^^ attempt to divide `1_i32` by zero
    |
 note: the lint level is defined here
   --> $DIR/promoted_errors.rs:9:41
@@ -50,13 +50,13 @@ warning: this operation will panic at runtime
   --> $DIR/promoted_errors.rs:20:14
    |
 LL |     let _x = 1 / (1 - 1);
-   |              ^^^^^^^^^^^ attempt to divide 1_i32 by zero
+   |              ^^^^^^^^^^^ attempt to divide `1_i32` by zero
 
 warning: this operation will panic at runtime
   --> $DIR/promoted_errors.rs:22:20
    |
 LL |     println!("{}", 1 / (false as u32));
-   |                    ^^^^^^^^^^^^^^^^^^ attempt to divide 1_u32 by zero
+   |                    ^^^^^^^^^^^^^^^^^^ attempt to divide `1_u32` by zero
 
 warning: reaching this expression at runtime will panic or abort
   --> $DIR/promoted_errors.rs:22:20
@@ -74,7 +74,7 @@ warning: this operation will panic at runtime
   --> $DIR/promoted_errors.rs:26:14
    |
 LL |     let _x = 1 / (false as u32);
-   |              ^^^^^^^^^^^^^^^^^^ attempt to divide 1_u32 by zero
+   |              ^^^^^^^^^^^^^^^^^^ attempt to divide `1_u32` by zero
 
 warning: 10 warnings emitted
 
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 ecdba2f1c50..5be0fd96723 100644
--- a/src/test/ui/consts/const-eval/pub_const_err.stderr
+++ b/src/test/ui/consts/const-eval/pub_const_err.stderr
@@ -4,7 +4,7 @@ warning: any use of this value will cause an error
 LL | pub const Z: u32 = 0 - 1;
    | -------------------^^^^^-
    |                    |
-   |                    attempt to compute `0_u32 - 1_u32` which would overflow
+   |                    attempt to compute `0_u32 - 1_u32`, which would overflow
    |
 note: the lint level is defined here
   --> $DIR/pub_const_err.rs:2:9
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 b2b65767dc0..55f8a58ea94 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
@@ -4,7 +4,7 @@ warning: any use of this value will cause an error
 LL | pub const Z: u32 = 0 - 1;
    | -------------------^^^^^-
    |                    |
-   |                    attempt to compute `0_u32 - 1_u32` which would overflow
+   |                    attempt to compute `0_u32 - 1_u32`, which would overflow
    |
 note: the lint level is defined here
   --> $DIR/pub_const_err_bin.rs:2:9
diff --git a/src/test/ui/consts/const-eval/shift_overflow.stderr b/src/test/ui/consts/const-eval/shift_overflow.stderr
index 478769ca9ff..e8d4076a61a 100644
--- a/src/test/ui/consts/const-eval/shift_overflow.stderr
+++ b/src/test/ui/consts/const-eval/shift_overflow.stderr
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
   --> $DIR/shift_overflow.rs:3:9
    |
 LL |     X = 1 << ((u32::MAX as u64) + 1),
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to shift left by 4294967296_u64 which would overflow
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to shift left by `4294967296_u64`, which would overflow
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/consts/const-eval/unused-broken-const.stderr b/src/test/ui/consts/const-eval/unused-broken-const.stderr
index a13cb877888..0cb13790f2f 100644
--- a/src/test/ui/consts/const-eval/unused-broken-const.stderr
+++ b/src/test/ui/consts/const-eval/unused-broken-const.stderr
@@ -4,7 +4,7 @@ error: any use of this value will cause an error
 LL | const FOO: i32 = [][0];
    | -----------------^^^^^-
    |                  |
-   |                  index out of bounds: the len is 0 but the index is 0
+   |                  index out of bounds: the length is 0 but the index is 0
    |
    = note: `#[deny(const_err)]` on by default