From bfa7d44823717c30bc21abc1ca3675d0b78c80a2 Mon Sep 17 00:00:00 2001 From: DrMeepster <19316085+DrMeepster@users.noreply.github.com> Date: Sun, 27 Feb 2022 00:48:17 -0800 Subject: fix box icing when it has aggregate abi --- src/test/ui/box/issue-81270-ice.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test/ui/box/issue-81270-ice.rs (limited to 'src/test/ui') 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::alloc::AllocError> { + todo!() + } + unsafe fn deallocate(&self, _: std::ptr::NonNull, _: std::alloc::Layout) { + todo!() + } +} + +fn main() { + Box::new_in((), BigAllocator([0; 2])); +} -- cgit 1.4.1-3-g733a5