]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #5248 - ThibsG:ConstValues, r=flip1995
authorPhilipp Krones <hello@philkrones.com>
Wed, 15 Apr 2020 18:12:28 +0000 (20:12 +0200)
committerGitHub <noreply@github.com>
Wed, 15 Apr 2020 18:12:28 +0000 (20:12 +0200)
Add lint on large non scalar const

This PR adds the new lint `non_scalar_const` that aims to warn against `const` declaration of large arrays. For performance, because of inlining, large arrays should be preferably declared as `static`.

Note: i made this one to warn on all const arrays, whether they are in a body function or not. I don't know if this is really necessary, i could just reduce this lint to variables out of function scope.

Fixes: #400
changelog: add new lint for large non-scalar types declared as const

1  2 
CHANGELOG.md
clippy_lints/src/lib.rs
src/lintlist/mod.rs

diff --cc CHANGELOG.md
Simple merge
Simple merge
Simple merge