We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent beb1439 commit 4b022ebCopy full SHA for 4b022eb
1 file changed
src/impl_owned_array.rs
@@ -828,6 +828,9 @@ where D: Dimension
828
debug_assert!(axis.index() < self.ndim());
829
let self_dim = self.raw_dim();
830
let remaining_shape = self_dim.remove_axis(axis);
831
+
832
+ // Make sure added capacity doesn't overflow
833
+ debug_assert!(remaining_shape.size().checked_mul(additional).is_some());
834
let len_to_append = remaining_shape.size() * additional;
835
836
// Make sure new capacity is still in bounds
0 commit comments