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
This commit is contained in:
Bennet Bleßmann
2024-08-11 21:53:02 +02:00
parent cc51b8150d
commit 620bf385d1

View File

@@ -43,7 +43,10 @@ impl<T: RawBlockTraits> RawBlock<T> {
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>()
);
}
self.base = new_base;
self.top = self.base.add(cap);