[`let_and_return`]: avoid linting when code between last stmt and return expr is...
source link: https://github.com/rust-lang/rust-clippy/pull/12558
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
[let_and_return
]: avoid linting when code between last stmt and return expr is cfg'd out
#12558
Merged
Conversation
Fixes #9150
This moves span_contains_cfg
to utils and starts using it in let_and_return
as well.
changelog: [let_and_return
]: avoid linting when code between the last statement and the final return expression is #[cfg]
ed out
added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label
LGTM, thank you!
At one point, I would like some better support from rustc for stuff like this, but I'm also not quite sure how to do it better. For now, this is a solid solution.
Member
@bors r+ |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
No milestone
Successfully merging this pull request may close these issues.
let_and_return false positive in presence of [cfg]
ed out blocks
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK