mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
15 lines
247 B
Rust
15 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() {}
|