Skip to content

Conversation

@bend-n
Copy link
Contributor

@bend-n bend-n commented Dec 21, 2025

No description provided.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 21, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 21, 2025

r? @scottmcm

rustbot has assigned @scottmcm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

@bend-n bend-n force-pushed the trusted_len_spec_for_iter_next_chunk branch from eccda83 to 4c4a61b Compare December 21, 2025 18:31
@rust-log-analyzer

This comment has been minimized.

@bend-n bend-n force-pushed the trusted_len_spec_for_iter_next_chunk branch from 4c4a61b to 4a0dbad Compare December 21, 2025 18:42
return Err(unsafe { IntoIter::new_unchecked(array, 0..initialized) });
} else {
// SAFETY: must be at least N elements; safe to unwrap N elements.
return Ok(from_fn(|_| unsafe { self.next().unwrap_unchecked() }));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure: Since you're specializing anyway, maybe https://std.noratrieb.dev/x86_64-unknown-linux-gnu/core/iter/traits/unchecked_iterator/trait.UncheckedIterator.html#method.next_unchecked instead?

Suggested change
return Ok(from_fn(|_| unsafe { self.next().unwrap_unchecked() }));
return Ok(from_fn(|_| unsafe { self.next_unchecked() }));

@scottmcm
Copy link
Member

r? the8472

@rustbot rustbot assigned the8472 and unassigned scottmcm Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants