]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/transmute-size-mismatch-before-typeck.stderr
Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnr
[rust.git] / src / test / ui / consts / transmute-size-mismatch-before-typeck.stderr
1 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
2   --> $DIR/transmute-size-mismatch-before-typeck.rs:12:29
3    |
4 LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
5    |                             ^^^^^^^^^^^^^^^^^^^
6    |
7    = note: source type: `usize` (word size)
8    = note: target type: `&[u8]` (2 * word size)
9
10 error: aborting due to previous error
11
12 For more information about this error, try `rustc --explain E0512`.