Skip to content

Commit 70118e7

Browse files
committed
Apply #[rustc_panics_when_n_is_zero] to the relevant core functions
1 parent 586788d commit 70118e7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

library/core/src/slice/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,7 @@ impl<T> [T] {
13321332
/// ```
13331333
#[stable(feature = "slice_as_chunks", since = "1.88.0")]
13341334
#[rustc_const_stable(feature = "slice_as_chunks", since = "1.88.0")]
1335+
#[rustc_panics_when_n_is_zero]
13351336
#[inline]
13361337
#[must_use]
13371338
#[track_caller]
@@ -1390,6 +1391,7 @@ impl<T> [T] {
13901391
/// ```
13911392
#[stable(feature = "slice_as_chunks", since = "1.88.0")]
13921393
#[rustc_const_stable(feature = "slice_as_chunks", since = "1.88.0")]
1394+
#[rustc_panics_when_n_is_zero]
13931395
#[inline]
13941396
#[track_caller]
13951397
#[must_use]
@@ -1437,6 +1439,7 @@ impl<T> [T] {
14371439
/// ```
14381440
#[stable(feature = "slice_as_chunks", since = "1.88.0")]
14391441
#[rustc_const_stable(feature = "slice_as_chunks", since = "1.88.0")]
1442+
#[rustc_panics_when_n_is_zero]
14401443
#[inline]
14411444
#[track_caller]
14421445
#[must_use]
@@ -1492,6 +1495,7 @@ impl<T> [T] {
14921495
/// ```
14931496
#[stable(feature = "slice_as_chunks", since = "1.88.0")]
14941497
#[rustc_const_stable(feature = "slice_as_chunks", since = "1.88.0")]
1498+
#[rustc_panics_when_n_is_zero]
14951499
#[inline]
14961500
#[must_use]
14971501
#[track_caller]
@@ -1546,6 +1550,7 @@ impl<T> [T] {
15461550
/// ```
15471551
#[stable(feature = "slice_as_chunks", since = "1.88.0")]
15481552
#[rustc_const_stable(feature = "slice_as_chunks", since = "1.88.0")]
1553+
#[rustc_panics_when_n_is_zero]
15491554
#[inline]
15501555
#[track_caller]
15511556
#[must_use]
@@ -1599,6 +1604,7 @@ impl<T> [T] {
15991604
/// ```
16001605
#[stable(feature = "slice_as_chunks", since = "1.88.0")]
16011606
#[rustc_const_stable(feature = "slice_as_chunks", since = "1.88.0")]
1607+
#[rustc_panics_when_n_is_zero]
16021608
#[inline]
16031609
#[track_caller]
16041610
#[must_use]
@@ -1641,6 +1647,7 @@ impl<T> [T] {
16411647
/// [`windows`]: slice::windows
16421648
#[stable(feature = "array_windows", since = "1.94.0")]
16431649
#[rustc_const_unstable(feature = "const_slice_make_iter", issue = "137737")]
1650+
#[rustc_panics_when_n_is_zero]
16441651
#[inline]
16451652
#[track_caller]
16461653
pub const fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N> {

0 commit comments

Comments
 (0)