Skip to content
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

Idea: warning on empty ranges #330

Closed
Wilfred opened this issue Sep 14, 2015 · 2 comments
Closed

Idea: warning on empty ranges #330

Wilfred opened this issue Sep 14, 2015 · 2 comments
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy T-AST Type: Requires working with the AST

Comments

@Wilfred
Copy link
Contributor

Wilfred commented Sep 14, 2015

I have occasionally written for x in 10..0 when I meant (0..10).rev(). Would this make sense as a clippy warning?

@Manishearth Manishearth added good-first-issue These issues are a good way to get started with Clippy T-AST Type: Requires working with the AST A-lint Area: New lints labels Sep 14, 2015
swgillespie added a commit to swgillespie/rust-clippy that referenced this issue Sep 15, 2015
Manishearth added a commit that referenced this issue Sep 15, 2015
implement iterating over an empty range lint as described in #330
@llogiq
Copy link
Contributor

llogiq commented Sep 15, 2015

Seems to be at least somewhat related to #96.

If this is going to grow into a larger range-iter lint, we should be aware of all edge cases arising from .rev() and .step_by().

@Manishearth
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy T-AST Type: Requires working with the AST
Projects
None yet
Development

No branches or pull requests

3 participants