rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

Get the block content from the proper context

Open samueltardieu opened this issue 7 months ago • 1 comments

The first statement of the block might have been in a different context from the expression. Walk up to the right context to get bounds properly.

Also, switch to snippet_with_applicability() since we know that we are in the right context already.

changelog: [if_then_some_else_none]: emit well-formed suggestion, and do not lint inside macros

Fixes rust-lang/rust-clippy#15005

samueltardieu avatar Jun 08 '25 07:06 samueltardieu

r? @y21

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

rustbot avatar Jun 08 '25 07:06 rustbot

Rebased

samueltardieu avatar Jul 25 '25 20:07 samueltardieu

Lintcheck changes for bd33a02ea6c01a7053451b0205edb01e4172a601

Lint Added Removed Changed
clippy::if_then_some_else_none 0 24 39

This comment will be updated if you push new changes

github-actions[bot] avatar Jul 25 '25 20:07 github-actions[bot]