Skip to content

Commit 83dde88

Browse files
authored
Rollup merge of #98653 - TaKO8Ki:add-regression-test-for-79494, r=Mark-Simulacrum
Add regression test for #79494 closes #79494
2 parents d287726 + 9ebe2d0 commit 83dde88

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/test/rustdoc-ui/issue-79494.rs

+5
Original file line numberDiff line numberDiff line change
@@ -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
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
2+
--> $DIR/issue-79494.rs:5:29
3+
|
4+
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
5+
| ^^^^^^^^^^^^^^^^^^^
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

Comments
 (0)