

[`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
-
103
webhint Quick start user guide webhint is a customizable linting tool that helps you improve your site's accessibility, speed, cross-browser compatibility, and more by checking your code for best practices and common errors....
-
60
README.md xiblint The xiblint script will test .xib and .storyboard files for compliance with best practices and team policies. The...
-
66
README.md kube-score kube-score is a tool that does static code analysis of your Kubernetes object definitions. The output is a list of re...
-
46
Tooling for JavaScript is too good to not take advantage of, especially when paired with Visual Studio Code ! In a recent article, I posted about
-
21
README.md ESLint-plugin-React
-
3
Flake8 Config in Pyls for Code Linting.2020-11-05Nvim350 words 2 mins read 124 times readIn my
-
2
Create a PR to automatically fix code linting errors This Github workflow aims to automatically fix as many lint errors as possible. In particular, it executes eslint with --fix argument,...
-
1
Copy link Collaborator llogiq commented
-
15
Linting and Auto-formatting Ruby Code With RuboCop What if you could write sloppy code and have Ruby fix it for you automatically? With RuboCop, you can! Of course, linters and...
-
11
Improving MAUI & Xamarin Code Quality with Pre Git Commit LintingUsing husky & lint-staged to clean C# code commits & make it prettierThis tutorial,
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK