]> Repositorios git - scryer-prolog.git/commitdiff
include the type name for better pin-pointing of the error source
authorBennet Bleßmann <[email protected]>
Sun, 11 Aug 2024 19:53:02 +0000 (21:53 +0200)
committerBennet Bleßmann <[email protected]>
Sun, 11 Aug 2024 19:53:02 +0000 (21:53 +0200)
- 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

index 8282a94d32a0b82f274a5f0513cb6f13044e7f01..da75741529e6147210000537978aeb1f7a01a7bf 100644 (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);