summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-eval')
-rw-r--r--tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.rs5
-rw-r--r--tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.stderr11
-rw-r--r--tests/ui/consts/const-eval/erroneous-const.stderr2
-rw-r--r--tests/ui/consts/const-eval/erroneous-const2.stderr2
-rw-r--r--tests/ui/consts/const-eval/issue-44578.stderr6
-rw-r--r--tests/ui/consts/const-eval/issue-50814-2.stderr2
-rw-r--r--tests/ui/consts/const-eval/issue-50814.stderr2
-rw-r--r--tests/ui/consts/const-eval/panic-assoc-never-type.rs2
-rw-r--r--tests/ui/consts/const-eval/panic-assoc-never-type.stderr4
-rw-r--r--tests/ui/consts/const-eval/raw-bytes.32bit.stderr6
-rw-r--r--tests/ui/consts/const-eval/raw-bytes.64bit.stderr6
-rw-r--r--tests/ui/consts/const-eval/ub-int-array.64bit.stderr36
-rw-r--r--tests/ui/consts/const-eval/ub-int-array.rs8
-rw-r--r--tests/ui/consts/const-eval/ub-int-array.stderr (renamed from tests/ui/consts/const-eval/ub-int-array.32bit.stderr)8
-rw-r--r--tests/ui/consts/const-eval/ub-ref-ptr.stderr4
-rw-r--r--tests/ui/consts/const-eval/ub-uninhabit.rs16
-rw-r--r--tests/ui/consts/const-eval/ub-uninhabit.stderr14
-rw-r--r--tests/ui/consts/const-eval/ub-wide-ptr.stderr6
-rw-r--r--tests/ui/consts/const-eval/union-const-eval-field.stderr4
19 files changed, 75 insertions, 69 deletions
diff --git a/tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.rs b/tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.rs
new file mode 100644
index 000000000..0bf2f0e66
--- /dev/null
+++ b/tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.rs
@@ -0,0 +1,5 @@
+#![crate_type = "lib"]
+
+struct Bug([u8; panic!{"\t"}]);
+//~^ ERROR evaluation of constant value failed
+//~| NOTE: in this expansion of panic!
diff --git a/tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.stderr b/tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.stderr
new file mode 100644
index 000000000..82c63dd17
--- /dev/null
+++ b/tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.stderr
@@ -0,0 +1,11 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_panic-normalize-tabs-115498.rs:3:17
+ |
+LL | struct Bug([u8; panic!{"\t"}]);
+ | ^^^^^^^^^^^^ the evaluated program panicked at ' ', $DIR/const_panic-normalize-tabs-115498.rs:3:17
+ |
+ = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/erroneous-const.stderr b/tests/ui/consts/const-eval/erroneous-const.stderr
index 770f95062..0e31520fd 100644
--- a/tests/ui/consts/const-eval/erroneous-const.stderr
+++ b/tests/ui/consts/const-eval/erroneous-const.stderr
@@ -4,7 +4,7 @@ error[E0080]: evaluation of `PrintName::<i32>::VOID` failed
LL | const VOID: () = [()][2];
| ^^^^^^^ index out of bounds: the length is 1 but the index is 2
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/erroneous-const.rs:13:13
|
LL | PrintName::<T>::VOID;
diff --git a/tests/ui/consts/const-eval/erroneous-const2.stderr b/tests/ui/consts/const-eval/erroneous-const2.stderr
index 082c28765..4ca44694c 100644
--- a/tests/ui/consts/const-eval/erroneous-const2.stderr
+++ b/tests/ui/consts/const-eval/erroneous-const2.stderr
@@ -4,7 +4,7 @@ error[E0080]: evaluation of `PrintName::<i32>::VOID` failed
LL | const VOID: () = [()][2];
| ^^^^^^^ index out of bounds: the length is 1 but the index is 2
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/erroneous-const2.rs:13:9
|
LL | PrintName::<i32>::VOID;
diff --git a/tests/ui/consts/const-eval/issue-44578.stderr b/tests/ui/consts/const-eval/issue-44578.stderr
index f3952809e..c7aaee942 100644
--- a/tests/ui/consts/const-eval/issue-44578.stderr
+++ b/tests/ui/consts/const-eval/issue-44578.stderr
@@ -4,13 +4,13 @@ error[E0080]: evaluation of `<Bar<u16, u8> as Foo>::AMT` failed
LL | const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/issue-44578.rs:25:20
|
LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/issue-44578.rs:25:20
|
LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
@@ -18,7 +18,7 @@ LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
|
= note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/issue-44578.rs:25:20
|
LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
diff --git a/tests/ui/consts/const-eval/issue-50814-2.stderr b/tests/ui/consts/const-eval/issue-50814-2.stderr
index 956f7aec9..450fb0023 100644
--- a/tests/ui/consts/const-eval/issue-50814-2.stderr
+++ b/tests/ui/consts/const-eval/issue-50814-2.stderr
@@ -4,7 +4,7 @@ error[E0080]: evaluation of `<A<()> as Foo<()>>::BAR` failed
LL | const BAR: usize = [5, 6, 7][T::BOO];
| ^^^^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 42
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/issue-50814-2.rs:18:6
|
LL | &<A<T> as Foo<T>>::BAR
diff --git a/tests/ui/consts/const-eval/issue-50814.stderr b/tests/ui/consts/const-eval/issue-50814.stderr
index 05b6271f4..48a20d0bb 100644
--- a/tests/ui/consts/const-eval/issue-50814.stderr
+++ b/tests/ui/consts/const-eval/issue-50814.stderr
@@ -4,7 +4,7 @@ error[E0080]: evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
LL | const MAX: u8 = A::MAX + B::MAX;
| ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/issue-50814.rs:20:6
|
LL | &Sum::<U8, U8>::MAX
diff --git a/tests/ui/consts/const-eval/panic-assoc-never-type.rs b/tests/ui/consts/const-eval/panic-assoc-never-type.rs
index 1abe708d1..88ce5b0d8 100644
--- a/tests/ui/consts/const-eval/panic-assoc-never-type.rs
+++ b/tests/ui/consts/const-eval/panic-assoc-never-type.rs
@@ -11,5 +11,5 @@ impl PrintName {
}
fn main() {
- let _ = PrintName::VOID; //~ erroneous constant used
+ let _ = PrintName::VOID; //~ erroneous constant encountered
}
diff --git a/tests/ui/consts/const-eval/panic-assoc-never-type.stderr b/tests/ui/consts/const-eval/panic-assoc-never-type.stderr
index 7c36a3a42..4706497db 100644
--- a/tests/ui/consts/const-eval/panic-assoc-never-type.stderr
+++ b/tests/ui/consts/const-eval/panic-assoc-never-type.stderr
@@ -6,13 +6,13 @@ LL | const VOID: ! = panic!();
|
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/panic-assoc-never-type.rs:14:13
|
LL | let _ = PrintName::VOID;
| ^^^^^^^^^^^^^^^
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/panic-assoc-never-type.rs:14:13
|
LL | let _ = PrintName::VOID;
diff --git a/tests/ui/consts/const-eval/raw-bytes.32bit.stderr b/tests/ui/consts/const-eval/raw-bytes.32bit.stderr
index e087a0ebe..042e7eeb3 100644
--- a/tests/ui/consts/const-eval/raw-bytes.32bit.stderr
+++ b/tests/ui/consts/const-eval/raw-bytes.32bit.stderr
@@ -341,7 +341,7 @@ LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
╾ALLOC_ID╼ │ ╾──╼
}
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/raw-bytes.rs:160:40
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
@@ -358,7 +358,7 @@ LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3
╾ALLOC_ID╼ │ ╾──╼
}
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/raw-bytes.rs:166:42
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
@@ -375,7 +375,7 @@ LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::tran
╾ALLOC_ID╼ │ ╾──╼
}
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/raw-bytes.rs:170:42
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
diff --git a/tests/ui/consts/const-eval/raw-bytes.64bit.stderr b/tests/ui/consts/const-eval/raw-bytes.64bit.stderr
index 4c655161f..8426a9505 100644
--- a/tests/ui/consts/const-eval/raw-bytes.64bit.stderr
+++ b/tests/ui/consts/const-eval/raw-bytes.64bit.stderr
@@ -341,7 +341,7 @@ LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
╾ALLOC_ID╼ │ ╾──────╼
}
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/raw-bytes.rs:160:40
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
@@ -358,7 +358,7 @@ LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3
╾ALLOC_ID╼ │ ╾──────╼
}
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/raw-bytes.rs:166:42
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
@@ -375,7 +375,7 @@ LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::tran
╾ALLOC_ID╼ │ ╾──────╼
}
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/raw-bytes.rs:170:42
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
diff --git a/tests/ui/consts/const-eval/ub-int-array.64bit.stderr b/tests/ui/consts/const-eval/ub-int-array.64bit.stderr
deleted file mode 100644
index b3df41304..000000000
--- a/tests/ui/consts/const-eval/ub-int-array.64bit.stderr
+++ /dev/null
@@ -1,36 +0,0 @@
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-int-array.rs:19:1
- |
-LL | const UNINIT_INT_0: [u32; 3] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized memory, but expected an integer
- |
- = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
- = note: the raw bytes of the constant (size: 12, align: 4) {
- __ __ __ __ 01 00 00 00 02 00 00 00 │ ░░░░........
- }
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-int-array.rs:24:1
- |
-LL | const UNINIT_INT_1: [u32; 3] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [1]: encountered uninitialized memory, but expected an integer
- |
- = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
- = note: the raw bytes of the constant (size: 12, align: 4) {
- 00 00 00 00 01 __ 01 01 02 02 __ 02 │ .....░....░.
- }
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-int-array.rs:42:1
- |
-LL | const UNINIT_INT_2: [u32; 3] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [2]: encountered uninitialized memory, but expected an integer
- |
- = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
- = note: the raw bytes of the constant (size: 12, align: 4) {
- 00 00 00 00 01 01 01 01 02 02 02 __ │ ...........░
- }
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/ub-int-array.rs b/tests/ui/consts/const-eval/ub-int-array.rs
index adcf376b9..cde0749dc 100644
--- a/tests/ui/consts/const-eval/ub-int-array.rs
+++ b/tests/ui/consts/const-eval/ub-int-array.rs
@@ -1,4 +1,3 @@
-// stderr-per-bitwidth
//! Test the "array of int" fast path in validity checking, and in particular whether it
//! points at the right array element.
@@ -19,7 +18,12 @@ impl<T: Copy> MaybeUninit<T> {
const UNINIT_INT_0: [u32; 3] = unsafe {
//~^ ERROR it is undefined behavior to use this value
//~| invalid value at [0]
- mem::transmute([MaybeUninit { uninit: () }, MaybeUninit::new(1), MaybeUninit::new(2)])
+ mem::transmute([
+ MaybeUninit { uninit: () },
+ // Constants chosen to achieve endianness-independent hex dump.
+ MaybeUninit::new(0x11111111),
+ MaybeUninit::new(0x22222222),
+ ])
};
const UNINIT_INT_1: [u32; 3] = unsafe {
//~^ ERROR it is undefined behavior to use this value
diff --git a/tests/ui/consts/const-eval/ub-int-array.32bit.stderr b/tests/ui/consts/const-eval/ub-int-array.stderr
index b3df41304..c8efd7e1b 100644
--- a/tests/ui/consts/const-eval/ub-int-array.32bit.stderr
+++ b/tests/ui/consts/const-eval/ub-int-array.stderr
@@ -1,16 +1,16 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-int-array.rs:19:1
+ --> $DIR/ub-int-array.rs:18:1
|
LL | const UNINIT_INT_0: [u32; 3] = unsafe {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized memory, but expected an integer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 12, align: 4) {
- __ __ __ __ 01 00 00 00 02 00 00 00 │ ░░░░........
+ __ __ __ __ 11 11 11 11 22 22 22 22 │ ░░░░....""""
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-int-array.rs:24:1
+ --> $DIR/ub-int-array.rs:28:1
|
LL | const UNINIT_INT_1: [u32; 3] = unsafe {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [1]: encountered uninitialized memory, but expected an integer
@@ -21,7 +21,7 @@ LL | const UNINIT_INT_1: [u32; 3] = unsafe {
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-int-array.rs:42:1
+ --> $DIR/ub-int-array.rs:46:1
|
LL | const UNINIT_INT_2: [u32; 3] = unsafe {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [2]: encountered uninitialized memory, but expected an integer
diff --git a/tests/ui/consts/const-eval/ub-ref-ptr.stderr b/tests/ui/consts/const-eval/ub-ref-ptr.stderr
index 0ee1e6087..6d5c36cea 100644
--- a/tests/ui/consts/const-eval/ub-ref-ptr.stderr
+++ b/tests/ui/consts/const-eval/ub-ref-ptr.stderr
@@ -60,7 +60,7 @@ LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/ub-ref-ptr.rs:36:38
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
@@ -75,7 +75,7 @@ LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[us
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/ub-ref-ptr.rs:39:85
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
diff --git a/tests/ui/consts/const-eval/ub-uninhabit.rs b/tests/ui/consts/const-eval/ub-uninhabit.rs
index 10edae437..01600f545 100644
--- a/tests/ui/consts/const-eval/ub-uninhabit.rs
+++ b/tests/ui/consts/const-eval/ub-uninhabit.rs
@@ -1,7 +1,10 @@
// Strip out raw byte dumps to make comparison platform-independent:
// normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*a(lloc)?[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
+#![feature(core_intrinsics)]
+#![feature(never_type)]
+use std::intrinsics;
use std::mem;
#[derive(Copy, Clone)]
@@ -15,11 +18,24 @@ union MaybeUninit<T: Copy> {
const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
//~^ ERROR evaluation of constant value failed
+//~| constructing invalid value
const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
//~^ ERROR it is undefined behavior to use this value
+//~| constructing invalid value
const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
//~^ ERROR evaluation of constant value failed
+//~| constructing invalid value
+
+
+const READ_NEVER: () = unsafe {
+ let mem = [0u32; 8];
+ let ptr = mem.as_ptr().cast::<!>();
+ let _val = intrinsics::read_via_copy(ptr);
+ //~^ ERROR evaluation of constant value failed
+ //~| constructing invalid value
+};
+
fn main() {}
diff --git a/tests/ui/consts/const-eval/ub-uninhabit.stderr b/tests/ui/consts/const-eval/ub-uninhabit.stderr
index f1ad0f04d..d26f4e036 100644
--- a/tests/ui/consts/const-eval/ub-uninhabit.stderr
+++ b/tests/ui/consts/const-eval/ub-uninhabit.stderr
@@ -1,11 +1,11 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-uninhabit.rs:16:35
+ --> $DIR/ub-uninhabit.rs:19:35
|
LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type `Bar`
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-uninhabit.rs:19:1
+ --> $DIR/ub-uninhabit.rs:23:1
|
LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar
@@ -16,11 +16,17 @@ LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
}
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-uninhabit.rs:22:42
+ --> $DIR/ub-uninhabit.rs:27:42
|
LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type `Bar`
-error: aborting due to 3 previous errors
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-uninhabit.rs:35:16
+ |
+LL | let _val = intrinsics::read_via_copy(ptr);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of the never type `!`
+
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/ub-wide-ptr.stderr b/tests/ui/consts/const-eval/ub-wide-ptr.stderr
index 02bbbf504..d8add67fa 100644
--- a/tests/ui/consts/const-eval/ub-wide-ptr.stderr
+++ b/tests/ui/consts/const-eval/ub-wide-ptr.stderr
@@ -139,7 +139,7 @@ LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
HEX_DUMP
}
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/ub-wide-ptr.rs:85:40
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
@@ -156,7 +156,7 @@ LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3
HEX_DUMP
}
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/ub-wide-ptr.rs:92:42
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
@@ -173,7 +173,7 @@ LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::tran
HEX_DUMP
}
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/ub-wide-ptr.rs:96:42
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
diff --git a/tests/ui/consts/const-eval/union-const-eval-field.stderr b/tests/ui/consts/const-eval/union-const-eval-field.stderr
index 9899c56c0..ce260300f 100644
--- a/tests/ui/consts/const-eval/union-const-eval-field.stderr
+++ b/tests/ui/consts/const-eval/union-const-eval-field.stderr
@@ -4,13 +4,13 @@ error[E0080]: evaluation of constant value failed
LL | const FIELD3: Field3 = unsafe { UNION.field3 };
| ^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/union-const-eval-field.rs:31:5
|
LL | FIELD3
| ^^^^^^
-note: erroneous constant used
+note: erroneous constant encountered
--> $DIR/union-const-eval-field.rs:31:5
|
LL | FIELD3