about summary refs log tree commit diff
path: root/src/test/ui/box
diff options
context:
space:
mode:
authorDrMeepster <19316085+DrMeepster@users.noreply.github.com>2022-02-27 00:48:17 -0800
committerDrMeepster <19316085+DrMeepster@users.noreply.github.com>2022-02-27 00:48:17 -0800
commitbfa7d44823717c30bc21abc1ca3675d0b78c80a2 (patch)
tree346f9e6b4d595e4dc2b8f32327bf3f9b0aadcc03 /src/test/ui/box
parent6cbc6c35e4b0c948114619a1c883a75b731d32c5 (diff)
downloadrust-bfa7d44823717c30bc21abc1ca3675d0b78c80a2.tar.gz
rust-bfa7d44823717c30bc21abc1ca3675d0b78c80a2.zip
fix box icing when it has aggregate abi
Diffstat (limited to 'src/test/ui/box')
-rw-r--r--src/test/ui/box/issue-81270-ice.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/box/issue-81270-ice.rs b/src/test/ui/box/issue-81270-ice.rs
new file mode 100644
index 00000000000..fb42aed7aae
--- /dev/null
+++ b/src/test/ui/box/issue-81270-ice.rs
@@ -0,0 +1,22 @@
+// check-pass
+#![feature(allocator_api)]
+
+use std::alloc::Allocator;
+
+struct BigAllocator([usize; 2]);
+
+unsafe impl Allocator for BigAllocator {
+    fn allocate(
+        &self,
+        _: std::alloc::Layout,
+    ) -> Result<std::ptr::NonNull<[u8]>, std::alloc::AllocError> {
+        todo!()
+    }
+    unsafe fn deallocate(&self, _: std::ptr::NonNull<u8>, _: std::alloc::Layout) {
+        todo!()
+    }
+}
+
+fn main() {
+    Box::new_in((), BigAllocator([0; 2]));
+}