about summary refs log tree commit diff
path: root/src/test/ui/consts
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2021-05-15 18:02:39 +0200
committerRalf Jung <post@ralfj.de>2021-05-15 18:02:39 +0200
commit8af76cb64d5ccb4a8a828fc3627ba8e390e4641f (patch)
tree61acdcd557ec43a8673cb67a012f202ea33ee3e3 /src/test/ui/consts
parentf1fdbe2b7bca5b628e59f14e2196e5d33f217ab7 (diff)
downloadrust-8af76cb64d5ccb4a8a828fc3627ba8e390e4641f.tar.gz
rust-8af76cb64d5ccb4a8a828fc3627ba8e390e4641f.zip
split ui test stderr by bitwidth
Diffstat (limited to 'src/test/ui/consts')
-rw-r--r--src/test/ui/consts/issue-83182.32bit.stderr14
-rw-r--r--src/test/ui/consts/issue-83182.64bit.stderr (renamed from src/test/ui/consts/issue-83182.stderr)2
-rw-r--r--src/test/ui/consts/issue-83182.rs2
3 files changed, 17 insertions, 1 deletions
diff --git a/src/test/ui/consts/issue-83182.32bit.stderr b/src/test/ui/consts/issue-83182.32bit.stderr
new file mode 100644
index 00000000000..3352f0e1724
--- /dev/null
+++ b/src/test/ui/consts/issue-83182.32bit.stderr
@@ -0,0 +1,14 @@
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/issue-83182.rs:5:1
+   |
+LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) };
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer in `str` at .<deref>.0
+   |
+   = 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: 4) {
+               ╾─alloc3──╼ 01 00 00 00                         │ ╾──╼....
+           }
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/issue-83182.stderr b/src/test/ui/consts/issue-83182.64bit.stderr
index f7ee6a21ab2..b7570720748 100644
--- a/src/test/ui/consts/issue-83182.stderr
+++ b/src/test/ui/consts/issue-83182.64bit.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/issue-83182.rs:3:1
+  --> $DIR/issue-83182.rs:5:1
    |
 LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer in `str` at .<deref>.0
diff --git a/src/test/ui/consts/issue-83182.rs b/src/test/ui/consts/issue-83182.rs
index 13c6e94f101..55a0722e5dd 100644
--- a/src/test/ui/consts/issue-83182.rs
+++ b/src/test/ui/consts/issue-83182.rs
@@ -1,3 +1,5 @@
+// stderr-per-bitwidth
+
 use std::mem;
 struct MyStr(str);
 const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) };