Skip to content

Commit

Permalink
include the type name for better pin-pointing of the error source
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
Skgland committed Aug 11, 2024
1 parent cc51b81 commit 620bf38
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/raw_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 620bf38

Please sign in to comment.