Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d40f24e commit 9ebe2d0Copy full SHA for 9ebe2d0
src/test/rustdoc-ui/issue-79494.rs
@@ -0,0 +1,5 @@
1
+// only-x86_64-unknown-linux-gnu
2
+
3
+#![feature(const_transmute)]
4
5
+const ZST: &[u8] = unsafe { std::mem::transmute(1usize) }; //~ ERROR cannot transmute between types of different sizes, or dependently-sized types
src/test/rustdoc-ui/issue-79494.stderr
@@ -0,0 +1,12 @@
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/issue-79494.rs:5:29
+ |
+LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
+ | ^^^^^^^^^^^^^^^^^^^
6
7
+ = note: source type: `usize` (64 bits)
8
+ = note: target type: `&[u8]` (128 bits)
9
10
+error: aborting due to previous error
11
12
+For more information about this error, try `rustc --explain E0512`.
0 commit comments