Skip to content

iter::repeat_with, iter::successors, iter::from_fn added as diagnostic items - #162613

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
voodookiidoo:add-iter-diagnostic-items
Sep 11, 2026
Merged

iter::repeat_with, iter::successors, iter::from_fn added as diagnostic items#162613
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
voodookiidoo:add-iter-diagnostic-items

Conversation

@voodookiidoo

@voodookiidoo voodookiidoo commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

added iter::repeat_with, iter::successors, iter::from_fn as diagnostic items, in order for clippy to be able to register them and work with them. Link to clippy issue: rust-lang/rust-clippy#17719

@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 Sep 10, 2026
@rustbot

rustbot commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @Mark-Simulacrum (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Please see the contribution instructions and our LLM policy for more information.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from Darksonn, JohnTitor, Mark-Simulacrum

@voodookiidoo voodookiidoo changed the title iter::repeat_with and iter::successors added as diagnostic items iter::repeat_with, iter::successors, iter::from_fn added as diagnostic items Sep 10, 2026

@mejrs mejrs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't it make more sense to put the diagnostic item on the structs themselves? rather than the functions that produce them?

View changes since this review

Comment thread library/core/src/iter/sources/repeat_with.rs Outdated
@voodookiidoo

voodookiidoo commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Wouldn't it make more sense to put the diagnostic item on the structs themselves? rather than the functions that produce them?

Existing examples (see repeat.rs) put that macro on the function itself, instead of the struct. Also - doesn't clippy require diagnostic_item macro on the func itself for it to be indexed/registered for analysis?

item_name fix

Co-authored-by: Bruno Kolenbrander <59372212+mejrs@users.noreply.github.com>

@mejrs mejrs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 98d3e1b has been approved by mejrs

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 Sep 10, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Sep 10, 2026
…tems, r=mejrs

iter::repeat_with, iter::successors, iter::from_fn added as diagnostic items

added iter::repeat_with, iter::successors, iter::from_fn as diagnostic items, in order for clippy to be able to register them and work with them. Link to clippy issue: rust-lang/rust-clippy#17719
rust-bors Bot pushed a commit that referenced this pull request Sep 11, 2026
Rollup of 5 pull requests

Successful merges:

 - #162270 (Update `windows-bindgen` to 0.100.0)
 - #162492 (Revert "Rollup merge of #157518 - CAD97:xdg_basedir, r=aapoalas")
 - #162607 (Basic cleanup in `rustc_transmute`)
 - #162514 (Simplify diagnostic levels)
 - #162613 (iter::repeat_with, iter::successors, iter::from_fn added as diagnostic items)
rust-bors Bot pushed a commit that referenced this pull request Sep 11, 2026
Rollup of 10 pull requests

Successful merges:

 - #162270 (Update `windows-bindgen` to 0.100.0)
 - #162492 (Revert "Rollup merge of #157518 - CAD97:xdg_basedir, r=aapoalas")
 - #162607 (Basic cleanup in `rustc_transmute`)
 - #162619 (Add test for the missing Clone requirement for Cow slices)
 - #162172 (mention the opaque when its hidden type cannot be inferred)
 - #162514 (Simplify diagnostic levels)
 - #162546 (Use lld by default on `loongarch64-unknown-linux-gnu` nightly)
 - #162564 (yeet StabilityLevel)
 - #162613 (iter::repeat_with, iter::successors, iter::from_fn added as diagnostic items)
 - #162616 (regression test for async main diagnostic)
@rust-bors
rust-bors Bot merged commit ae7ebc8 into rust-lang:main Sep 11, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 11, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 11, 2026
Rollup merge of #162613 - voodookiidoo:add-iter-diagnostic-items, r=mejrs

iter::repeat_with, iter::successors, iter::from_fn added as diagnostic items

added iter::repeat_with, iter::successors, iter::from_fn as diagnostic items, in order for clippy to be able to register them and work with them. Link to clippy issue: rust-lang/rust-clippy#17719
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.

4 participants