Skip to content

Document Repeat::last panic behavior#157323

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
majiayu000:docs-repeat-last-panic
Jun 8, 2026
Merged

Document Repeat::last panic behavior#157323
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
majiayu000:docs-repeat-last-panic

Conversation

@majiayu000

@majiayu000 majiayu000 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #149707

Documents that Repeat::last always panics because Repeat is infinite.

Tests:

  • ./x fmt --check
  • ./x doc library/core
  • ./x test library/core

@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 Jun 2, 2026
@rustbot

rustbot commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 8 candidates
  • Random selection from LawnGnome, Mark-Simulacrum, jhpratt

@jhpratt

jhpratt commented Jun 7, 2026

Copy link
Copy Markdown
Member

Can you do the same for count, which has identical behavior?

r? jhpratt

@rustbot author

@rustbot rustbot assigned jhpratt and unassigned Mark-Simulacrum Jun 7, 2026
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 7, 2026
@rustbot

rustbot commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@majiayu000

Copy link
Copy Markdown
Contributor Author

Added the same panic documentation for Repeat::count.

Tests:

  • ./x fmt --check

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 7, 2026
@jhpratt

jhpratt commented Jun 7, 2026

Copy link
Copy Markdown
Member

In the future, please disclose LLM usage.

@jhpratt

jhpratt commented Jun 7, 2026

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a23630f has been approved by jhpratt

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 7, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 7, 2026
… r=jhpratt

Document Repeat::last panic behavior

Fixes rust-lang#149707

Documents that `Repeat::last` always panics because `Repeat` is infinite.

Tests:
- `./x fmt --check`
- `./x doc library/core`
- `./x test library/core`
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 7, 2026
… r=jhpratt

Document Repeat::last panic behavior

Fixes rust-lang#149707

Documents that `Repeat::last` always panics because `Repeat` is infinite.

Tests:
- `./x fmt --check`
- `./x doc library/core`
- `./x test library/core`
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 7, 2026
… r=jhpratt

Document Repeat::last panic behavior

Fixes rust-lang#149707

Documents that `Repeat::last` always panics because `Repeat` is infinite.

Tests:
- `./x fmt --check`
- `./x doc library/core`
- `./x test library/core`
rust-bors Bot pushed a commit that referenced this pull request Jun 7, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #157447 (Move cross crate tests into the appropriate folder)
 - #145108 (Resolver: Batched Import Resolution)
 - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`)
 - #157289 (Add infallible primitive type lookups to template arg resolver)
 - #157540 (Cleanup and optimize `render_impls`)
 - #157543 (Reorganize `tests/ui/issues` [5/N])
 - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable)
 - #157323 (Document Repeat::last panic behavior)
 - #157545 (Suggest using comma to separate valid attribute list items)
 - #157559 (chore: Update annotate-snippets to 0.12.16)
rust-bors Bot pushed a commit that referenced this pull request Jun 7, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #157447 (Move cross crate tests into the appropriate folder)
 - #145108 (Resolver: Batched Import Resolution)
 - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`)
 - #157289 (Add infallible primitive type lookups to template arg resolver)
 - #157540 (Cleanup and optimize `render_impls`)
 - #157543 (Reorganize `tests/ui/issues` [5/N])
 - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable)
 - #157323 (Document Repeat::last panic behavior)
 - #157545 (Suggest using comma to separate valid attribute list items)
 - #157559 (chore: Update annotate-snippets to 0.12.16)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 7, 2026
… r=jhpratt

Document Repeat::last panic behavior

Fixes rust-lang#149707

Documents that `Repeat::last` always panics because `Repeat` is infinite.

Tests:
- `./x fmt --check`
- `./x doc library/core`
- `./x test library/core`
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 7, 2026
… r=jhpratt

Document Repeat::last panic behavior

Fixes rust-lang#149707

Documents that `Repeat::last` always panics because `Repeat` is infinite.

Tests:
- `./x fmt --check`
- `./x doc library/core`
- `./x test library/core`
rust-bors Bot pushed a commit that referenced this pull request Jun 7, 2026
Rollup of 25 pull requests

Successful merges:

 - #157447 (Move cross crate tests into the appropriate folder)
 - #145108 (Resolver: Batched Import Resolution)
 - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`)
 - #157224 (Manually unroll loop in `str::floor_char_boundary`)
 - #157289 (Add infallible primitive type lookups to template arg resolver)
 - #157540 (Cleanup and optimize `render_impls`)
 - #157444 (Couple of work product cleanups)
 - #157543 (Reorganize `tests/ui/issues` [5/N])
 - #153513 (Syntactically reject equality predicates)
 - #155797 (LineWriter: cap write_vectored newline scan to avoid quadratic write_all_vectored)
 - #156155 (macros: report unbound metavariables directly)
 - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable)
 - #156666 (Clarify meaning of ranges in pointer offset docs)
 - #157078 (Document equivalence of `highest_one` and `ilog2` methods on integers)
 - #157129 (ci: update download-artifact action to v8)
 - #157169 (triagebot: Update messages to direct changes to appropriate repositories)
 - #157323 (Document Repeat::last panic behavior)
 - #157370 (Clarify MaybeUninit::zeroed padding docs)
 - #157399 (Silence llbc's output by default to prevent rustc's linker output warning)
 - #157500 (Improve documentation of `align_of` and `Alignment`.)
 - #157545 (Suggest using comma to separate valid attribute list items)
 - #157559 (chore: Update annotate-snippets to 0.12.16)
 - #157560 (In `copy_nonoverlapping`, use `mul nuw nsw` to compute the byte size)
 - #157580 (Importing suggestion reported twice when reporting privacy error)
 - #157581 (Test fixup)
rust-bors Bot pushed a commit that referenced this pull request Jun 7, 2026
Rollup of 25 pull requests

Successful merges:

 - #157447 (Move cross crate tests into the appropriate folder)
 - #145108 (Resolver: Batched Import Resolution)
 - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`)
 - #157224 (Manually unroll loop in `str::floor_char_boundary`)
 - #157289 (Add infallible primitive type lookups to template arg resolver)
 - #157540 (Cleanup and optimize `render_impls`)
 - #157444 (Couple of work product cleanups)
 - #157543 (Reorganize `tests/ui/issues` [5/N])
 - #153513 (Syntactically reject equality predicates)
 - #155797 (LineWriter: cap write_vectored newline scan to avoid quadratic write_all_vectored)
 - #156155 (macros: report unbound metavariables directly)
 - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable)
 - #156666 (Clarify meaning of ranges in pointer offset docs)
 - #157078 (Document equivalence of `highest_one` and `ilog2` methods on integers)
 - #157129 (ci: update download-artifact action to v8)
 - #157169 (triagebot: Update messages to direct changes to appropriate repositories)
 - #157323 (Document Repeat::last panic behavior)
 - #157370 (Clarify MaybeUninit::zeroed padding docs)
 - #157399 (Silence llbc's output by default to prevent rustc's linker output warning)
 - #157500 (Improve documentation of `align_of` and `Alignment`.)
 - #157545 (Suggest using comma to separate valid attribute list items)
 - #157559 (chore: Update annotate-snippets to 0.12.16)
 - #157560 (In `copy_nonoverlapping`, use `mul nuw nsw` to compute the byte size)
 - #157580 (Importing suggestion reported twice when reporting privacy error)
 - #157581 (Test fixup)
@rust-bors rust-bors Bot merged commit 1fcc354 into rust-lang:main Jun 8, 2026
12 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 8, 2026
rust-timer added a commit that referenced this pull request Jun 8, 2026
Rollup merge of #157323 - majiayu000:docs-repeat-last-panic, r=jhpratt

Document Repeat::last panic behavior

Fixes #149707

Documents that `Repeat::last` always panics because `Repeat` is infinite.

Tests:
- `./x fmt --check`
- `./x doc library/core`
- `./x test library/core`
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Jun 8, 2026
Rollup of 25 pull requests

Successful merges:

 - rust-lang/rust#157447 (Move cross crate tests into the appropriate folder)
 - rust-lang/rust#145108 (Resolver: Batched Import Resolution)
 - rust-lang/rust#156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`)
 - rust-lang/rust#157224 (Manually unroll loop in `str::floor_char_boundary`)
 - rust-lang/rust#157289 (Add infallible primitive type lookups to template arg resolver)
 - rust-lang/rust#157540 (Cleanup and optimize `render_impls`)
 - rust-lang/rust#157444 (Couple of work product cleanups)
 - rust-lang/rust#157543 (Reorganize `tests/ui/issues` [5/N])
 - rust-lang/rust#153513 (Syntactically reject equality predicates)
 - rust-lang/rust#155797 (LineWriter: cap write_vectored newline scan to avoid quadratic write_all_vectored)
 - rust-lang/rust#156155 (macros: report unbound metavariables directly)
 - rust-lang/rust#156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable)
 - rust-lang/rust#156666 (Clarify meaning of ranges in pointer offset docs)
 - rust-lang/rust#157078 (Document equivalence of `highest_one` and `ilog2` methods on integers)
 - rust-lang/rust#157129 (ci: update download-artifact action to v8)
 - rust-lang/rust#157169 (triagebot: Update messages to direct changes to appropriate repositories)
 - rust-lang/rust#157323 (Document Repeat::last panic behavior)
 - rust-lang/rust#157370 (Clarify MaybeUninit::zeroed padding docs)
 - rust-lang/rust#157399 (Silence llbc's output by default to prevent rustc's linker output warning)
 - rust-lang/rust#157500 (Improve documentation of `align_of` and `Alignment`.)
 - rust-lang/rust#157545 (Suggest using comma to separate valid attribute list items)
 - rust-lang/rust#157559 (chore: Update annotate-snippets to 0.12.16)
 - rust-lang/rust#157560 (In `copy_nonoverlapping`, use `mul nuw nsw` to compute the byte size)
 - rust-lang/rust#157580 (Importing suggestion reported twice when reporting privacy error)
 - rust-lang/rust#157581 (Test fixup)
asukaminato0721 pushed a commit to asukaminato0721/rust-analyzer that referenced this pull request Jun 8, 2026
Rollup of 25 pull requests

Successful merges:

 - rust-lang/rust#157447 (Move cross crate tests into the appropriate folder)
 - rust-lang/rust#145108 (Resolver: Batched Import Resolution)
 - rust-lang/rust#156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`)
 - rust-lang/rust#157224 (Manually unroll loop in `str::floor_char_boundary`)
 - rust-lang/rust#157289 (Add infallible primitive type lookups to template arg resolver)
 - rust-lang/rust#157540 (Cleanup and optimize `render_impls`)
 - rust-lang/rust#157444 (Couple of work product cleanups)
 - rust-lang/rust#157543 (Reorganize `tests/ui/issues` [5/N])
 - rust-lang/rust#153513 (Syntactically reject equality predicates)
 - rust-lang/rust#155797 (LineWriter: cap write_vectored newline scan to avoid quadratic write_all_vectored)
 - rust-lang/rust#156155 (macros: report unbound metavariables directly)
 - rust-lang/rust#156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable)
 - rust-lang/rust#156666 (Clarify meaning of ranges in pointer offset docs)
 - rust-lang/rust#157078 (Document equivalence of `highest_one` and `ilog2` methods on integers)
 - rust-lang/rust#157129 (ci: update download-artifact action to v8)
 - rust-lang/rust#157169 (triagebot: Update messages to direct changes to appropriate repositories)
 - rust-lang/rust#157323 (Document Repeat::last panic behavior)
 - rust-lang/rust#157370 (Clarify MaybeUninit::zeroed padding docs)
 - rust-lang/rust#157399 (Silence llbc's output by default to prevent rustc's linker output warning)
 - rust-lang/rust#157500 (Improve documentation of `align_of` and `Alignment`.)
 - rust-lang/rust#157545 (Suggest using comma to separate valid attribute list items)
 - rust-lang/rust#157559 (chore: Update annotate-snippets to 0.12.16)
 - rust-lang/rust#157560 (In `copy_nonoverlapping`, use `mul nuw nsw` to compute the byte size)
 - rust-lang/rust#157580 (Importing suggestion reported twice when reporting privacy error)
 - rust-lang/rust#157581 (Test fixup)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Document panic! for Iterator::last (Repeat)

4 participants