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

Lint against indexing and slicing #755

Closed
aochagavia opened this issue Mar 11, 2016 · 7 comments
Closed

Lint against indexing and slicing #755

aochagavia opened this issue Mar 11, 2016 · 7 comments

Comments

@aochagavia
Copy link
Contributor

Some projects (e.g. operating systems) need to be very careful about panics. Since indexing and slicing panic when indices are out of bounds, I think it would be useful to have a lint for that (allowed by default).

Does this fit the scope of clippy?

@oli-obk
Copy link
Contributor

oli-obk commented Mar 11, 2016

This would be one of the "restrictions" mentioned in #632

Hard to do cross crate though

@Manishearth
Copy link
Member

THis goes under the "restrictions" thing. Completely avoiding panics is global thing, and hard to do, but blacklisting certain operations is a good step.

@aochagavia
Copy link
Contributor Author

Does the "restrictions" thing require refactoring of clippy or could this particular lint be implemented without major changes?

@Manishearth
Copy link
Member

It requires refactoring of the lint groups machinery in the python script to be able to create more non-pedantic Allow groups.

@aochagavia
Copy link
Contributor Author

Hmmm... I am not familiar with the architecture of clippy, so I guess I would rather wait until those changes are in place before implementing this.

@Manishearth
Copy link
Member

Feel free to implement this as a regular pedantic Allow lint.

@aochagavia
Copy link
Contributor Author

Ok!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants