rust/src/test/ui/issues/issue-23477.rs

16 lines
247 B
Rust
Raw Normal View History

// build-pass
2019-10-01 22:09:53 +00:00
// compile-flags: -g
2016-06-12 20:45:48 +00:00
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
}
2016-06-13 21:27:13 +00:00
fn main() {}