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

16 lines
247 B
Rust
Raw Normal View History

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