Get the block content from the proper context
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
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
Rebased
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