summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-eval/union-ice.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/consts/const-eval/union-ice.stderr')
-rw-r--r--src/test/ui/consts/const-eval/union-ice.stderr38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-eval/union-ice.stderr b/src/test/ui/consts/const-eval/union-ice.stderr
new file mode 100644
index 000000000..21a545509
--- /dev/null
+++ b/src/test/ui/consts/const-eval/union-ice.stderr
@@ -0,0 +1,38 @@
+error[E0080]: it is undefined behavior to use this value
+ --> $DIR/union-ice.rs:14:1
+ |
+LL | const FIELD3: Field3 = unsafe { UNION.field3 };
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
+ |
+ = 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: 8, align: 8) {
+ __ __ __ __ __ __ __ __ │ ░░░░░░░░
+ }
+
+error[E0080]: it is undefined behavior to use this value
+ --> $DIR/union-ice.rs:16:1
+ |
+LL | const FIELD_PATH: Struct = Struct {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .b: encountered uninitialized bytes, but expected initialized bytes
+ |
+ = 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: 16, align: 8) {
+ __ __ __ __ __ __ __ __ 2a __ __ __ __ __ __ __ │ ░░░░░░░░*░░░░░░░
+ }
+
+error[E0080]: it is undefined behavior to use this value
+ --> $DIR/union-ice.rs:26:1
+ |
+LL | const FIELD_PATH2: Struct2 = Struct2 {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .b[1]: encountered uninitialized bytes
+ |
+ = 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: 40, align: 8) {
+ 0x00 │ 15 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░
+ 0x10 │ 17 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 │ ................
+ 0x20 │ 2a __ __ __ __ __ __ __ │ *░░░░░░░
+ }
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0080`.