Skip to content

filter_map_next: clean-up, overhaul suggestions#17237

Open
ada4a wants to merge 7 commits into
rust-lang:masterfrom
ada4a:cleanup-filter_map_next
Open

filter_map_next: clean-up, overhaul suggestions#17237
ada4a wants to merge 7 commits into
rust-lang:masterfrom
ada4a:cleanup-filter_map_next

Conversation

@ada4a

@ada4a ada4a commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

changelog: [filter_map_next]: overhaul suggestions

i.e. rename:
- filter_map_next -> filter_map_next_unfixable
- filter_map_next_fixable -> filter_map_next

This is because having fixable lints is the common case
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 14, 2026
@rustbot

rustbot commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

r? @llogiq

rustbot has assigned @llogiq.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: 8 candidates
  • 8 candidates expanded to 8 candidates
  • Random selection from Jarcho, dswij, llogiq, samueltardieu

@ada4a

ada4a commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Very similar in structure to #17233, cc @Jarcho you might be interested in reviewing this one as well

@ada4a ada4a force-pushed the cleanup-filter_map_next branch from 62f2e9b to 85ae0cd Compare June 14, 2026 12:29
ada4a added 4 commits June 14, 2026 14:31
separate commit to improve diffs
1. In the singe-line case, we switch to verbose suggestions, otherwise
   the suggestion line gets too long due to the longer message.
2. In the multi-line case, we use span-less help, otherwise the whole
   multiline span gets highlighted the second time.
3. Also make the suggestion message more concise.
@ada4a ada4a force-pushed the cleanup-filter_map_next branch from 85ae0cd to 30994a7 Compare June 14, 2026 12:32
@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown

Lintcheck changes for 473f7cd

Lint Added Removed Changed
clippy::filter_map_next 0 0 7

This comment will be updated if you push new changes

@llogiq llogiq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Apart from the world's smallest formatting nit, I'd like to see some tests where the iter and filter snippets contain comments.

View changes since this review

Comment thread tests/ui/filter_map_next.rs Outdated
#[rustfmt::skip]
let _: Option<u32> = vec![1, 2, 3, 4, 5, 6]
//~^ filter_map_next
//~^ filter_map_next

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason for this formatting change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope, just missed due to #[rustfmt::skip]:) Fixed!

ada4a added 2 commits June 22, 2026 12:26
This used to be a workaround for a rustc diagnostics issue which has
since been resolved
@ada4a ada4a force-pushed the cleanup-filter_map_next branch from 30994a7 to 473f7cd Compare June 22, 2026 10:32
@ada4a

ada4a commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants