diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 17f6373ecbf86..78fad46e7937e 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -814,7 +814,7 @@ impl [T] { #[stable(feature = "rust1", since = "1.0.0")] #[inline] pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T> { - assert_ne!(chunk_size, 0); + assert_ne!(chunk_size, 0, "chunks cannot have a size of zero"); Chunks::new(self, chunk_size) } @@ -852,7 +852,7 @@ impl [T] { #[stable(feature = "rust1", since = "1.0.0")] #[inline] pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T> { - assert_ne!(chunk_size, 0); + assert_ne!(chunk_size, 0, "chunks cannot have a size of zero"); ChunksMut::new(self, chunk_size) }