rust/tests/ui/issues/issue-23477.rs
2023-10-28 23:11:03 -07:00

16 lines
247 B
Rust

// build-pass
// compile-flags: -g
pub struct Dst {
pub a: (),
pub b: (),
pub data: [u8],
}
pub unsafe fn borrow(bytes: &[u8]) -> &Dst {
let dst: &Dst = std::mem::transmute((bytes.as_ptr(), bytes.len()));
dst
}
fn main() {}