]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/issue-83182.64bit.stderr
Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnr
[rust.git] / src / test / ui / consts / issue-83182.64bit.stderr
1 error[E0080]: it is undefined behavior to use this value
2   --> $DIR/issue-83182.rs:5:1
3    |
4 LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) };
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
6    |
7    = help: this code performed an operation that depends on the underlying bytes representing a pointer
8    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
9    = note: the raw bytes of the constant (size: 16, align: 8) {
10                ╾───────alloc4────────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
11            }
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0080`.