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

Warn for non-scalar const values #400

Closed
jdm opened this issue Oct 20, 2015 · 3 comments · Fixed by #5248
Closed

Warn for non-scalar const values #400

jdm opened this issue Oct 20, 2015 · 3 comments · Fixed by #5248
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy T-middle Type: Probably requires verifiying types

Comments

@jdm
Copy link

jdm commented Oct 20, 2015

servo/servo#8086 (comment)

This seems like an easy thing to mess up.

@Manishearth
Copy link
Member

Perhaps for sufficiently large arrays, at least (if not for all arrays)

@Manishearth Manishearth added good-first-issue These issues are a good way to get started with Clippy T-middle Type: Probably requires verifiying types A-lint Area: New lints labels Oct 20, 2015
@Manishearth
Copy link
Member

To do this, you'll need to add a new lint (Somewhere in https://github.com/Manishearth/rust-clippy/blob/master/src/misc.rs), with a check_item, that checks if the type (via this) is a TyArray with large size (http://manishearth.github.io/rust-internals-docs/rustc/middle/ty/enum.TypeVariants.html).

@llogiq
Copy link
Contributor

llogiq commented Oct 20, 2015

We have something similar in src/loops.rs, line 320.

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-middle Type: Probably requires verifiying types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants