Skip to content

Commit 3102b39

Browse files
committed
Use #[track_caller] to make panic in Iterator::array_chunks nicer
1 parent 4db628a commit 3102b39

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

library/core/src/iter/adapters/array_chunks.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ impl<I, const N: usize> ArrayChunks<I, N>
2424
where
2525
I: Iterator,
2626
{
27+
#[track_caller]
2728
pub(in crate::iter) fn new(iter: I) -> Self {
2829
assert!(N != 0, "chunk size must be non-zero");
2930
Self { iter: iter.fuse(), remainder: None }

library/core/src/iter/traits/iterator.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3350,6 +3350,7 @@ pub trait Iterator {
33503350
/// assert_eq!(x + y + z, 4);
33513351
/// }
33523352
/// ```
3353+
#[track_caller]
33533354
#[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "none")]
33543355
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
33553356
where

0 commit comments

Comments
 (0)