Add lint on large non scalar const#5248
Conversation
|
☔ The latest upstream changes (presumably #5230) made this pull request unmergeable. Please resolve the merge conflicts. |
flip1995
left a comment
There was a problem hiding this comment.
LGTM overall. The suggestion needs a small change, after that, this should be good to go.
6a197c0 to
ab25eee
Compare
|
☔ The latest upstream changes (presumably #5380) made this pull request unmergeable. Please resolve the merge conflicts. |
|
☔ The latest upstream changes (presumably #5294) made this pull request unmergeable. Please resolve the merge conflicts. |
|
☔ The latest upstream changes (presumably #5398) made this pull request unmergeable. Please resolve the merge conflicts. |
60ede1d to
3cedc6a
Compare
|
☔ The latest upstream changes (presumably #5438) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Thanks! Sorry for taking so long for the review. I don't have an excuse, just wasn't really motivated to review PRs recently. Waiting for rustup. |
|
@bors r+ rollup |
|
📌 Commit 629cc4a has been approved by |
|
🌲 The tree is currently closed for pull requests below priority 1, this pull request will be tested once the tree is reopened |
Rollup of 5 pull requests Successful merges: - #5226 (Add lint for explicit deref and deref_mut method calls) - #5248 (Add lint on large non scalar const) - #5430 (Disallow bit-shifting in integer_arithmetic) - #5466 (large_enum_variant: Report sizes of variants) - #5468 (Zero single char names) Failed merges: r? @ghost changelog: rollup
This PR adds the new lint
non_scalar_constthat aims to warn againstconstdeclaration of large arrays. For performance, because of inlining, large arrays should be preferably declared asstatic.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