From 620bf385d171bf4f0c1150fad692b3e0b03b31a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bennet=20Ble=C3=9Fmann?= Date: Sun, 11 Aug 2024 21:53:02 +0200 Subject: [PATCH] include the type name for better pin-pointing of the error source - only done here as all other places are non-generic and the panic already includes file and line info, only here are we in a generic context and might need more differentiation --- src/raw_block.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/raw_block.rs b/src/raw_block.rs index 8282a94d3..da7574152 100644 --- a/src/raw_block.rs +++ b/src/raw_block.rs @@ -43,7 +43,10 @@ impl RawBlock { let layout = alloc::Layout::from_size_align_unchecked(cap, T::align()); let new_base = alloc::alloc(layout).cast_const(); if new_base.is_null() { - panic!("failed to allocate for init_at_size"); + panic!( + "failed to allocate in init_at_size for {}", + std::any::type_name::() + ); } self.base = new_base; self.top = self.base.add(cap);