rust/tests/ui/issues/issue-23477.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
249 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() {}