From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../debuginfo-box-with-large-allocator.rs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/ui/debuginfo/debuginfo-box-with-large-allocator.rs (limited to 'tests/ui/debuginfo/debuginfo-box-with-large-allocator.rs') diff --git a/tests/ui/debuginfo/debuginfo-box-with-large-allocator.rs b/tests/ui/debuginfo/debuginfo-box-with-large-allocator.rs new file mode 100644 index 000000000..761539227 --- /dev/null +++ b/tests/ui/debuginfo/debuginfo-box-with-large-allocator.rs @@ -0,0 +1,23 @@ +// build-pass +// compile-flags: -Cdebuginfo=2 +// fixes issue #94725 + +#![feature(allocator_api)] + +use std::alloc::{AllocError, Allocator, Layout}; +use std::ptr::NonNull; + +struct ZST; + +unsafe impl Allocator for &ZST { + fn allocate(&self, layout: Layout) -> Result, AllocError> { + todo!() + } + unsafe fn deallocate(&self, ptr: NonNull, layout: Layout) { + todo!() + } +} + +fn main() { + let _ = Box::::new_in(43, &ZST); +} -- cgit v1.2.3