mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
22 lines
393 B
Rust
22 lines
393 B
Rust
//@ check-pass
|
|
//@ needs-asm-support
|
|
//@ only-x86_64
|
|
|
|
// This demonstrates why we need to erase regions before sized check in intrinsicck
|
|
|
|
struct NoCopy;
|
|
|
|
struct Wrap<'a, T, Tail: ?Sized>(&'a T, Tail);
|
|
|
|
pub unsafe fn test() {
|
|
let i = NoCopy;
|
|
let j = Wrap(&i, ());
|
|
let pointer = &j as *const _;
|
|
core::arch::asm!(
|
|
"nop",
|
|
in("eax") pointer,
|
|
);
|
|
}
|
|
|
|
fn main() {}
|