-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Range with inverse bounds without negative stepping #96
Comments
More concrete lint specification: Match bare uses of (Should we expand this to handle general cases or just do AST matching on loops?) |
Matching the AST is quite easy (a good portion of the code is already in Using this, we should be able to catch bare uses as well as uses where the |
Yep! |
Note: I'm tagging all the issues with an AST vs middle classification, as well as difficulty (medium is basically good second bug), to help newcomers. I'll add a CONTRIBUTING.md soon. |
The difficulty here is to ascertain the absence of |
We don't need to. As an AST match it's simple: we look for desugared for loops (i.e. match statements) which match on |
Fair enough – although that wouldn't catch The |
Getting the parent node is a fast operation (hashmap lookup+field access), btw, so I don't see why we need to cache it ourselves. |
Then we should provide a |
Btw, https://github.com/Manishearth/rust-clippy/blob/master/CONTRIBUTING.md. Let me know if you don't want to explicitly be listed as a mentor, I just added you since you have helped folks out a couple of times before 😄 |
I'm always glad to help. |
E.g. range(100, 0), but not range(100, 0).step_by(-1). Also skip if we have non-const bounds.
The text was updated successfully, but these errors were encountered: