summaryrefslogtreecommitdiffstats
path: root/src/test/ui/asm/issue-99122-2.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/asm/issue-99122-2.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/asm/issue-99122-2.rs b/src/test/ui/asm/issue-99122-2.rs
new file mode 100644
index 000000000..cfb9fd90a
--- /dev/null
+++ b/src/test/ui/asm/issue-99122-2.rs
@@ -0,0 +1,21 @@
+// 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() {}