-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
add size parameter for vec_box
lint
#5081
Conversation
9b9a220
to
6c6d865
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impl looks good, test is missing.
9f858e1
to
90697bf
Compare
clippy_lints/src/utils/conf.rs
Outdated
@@ -152,6 +152,8 @@ define_Conf! { | |||
(too_many_lines_threshold, "too_many_lines_threshold", 100 => u64), | |||
/// Lint: LARGE_STACK_ARRAYS. The maximum allowed size for arrays on the stack | |||
(array_size_threshold, "array_size_threshold", 512_000 => u64), | |||
/// Lint: VEC_BOX. The minimum required size for boxed type in Vec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Lint: VEC_BOX. The minimum required size for boxed type in Vec | |
/// Lint: VEC_BOX. The size of the boxed type in bytes, where boxing in a `Vec` is allowed |
Is 4kB based on something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Page size; but as I said in the pr, you are welcome to put any number you like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Page size sounds good.
90697bf
to
2b7bc26
Compare
@bors r+ Thanks! |
📌 Commit 2b7bc26 has been approved by |
add size parameter for `vec_box` lint changelog: add size threshold for the `vec_box` lint, currently 4096 bytes (one page) (subject to change). Closes #3547. diff is a little bit confusing due to some refactoring (moving free functions to lint struct functions), relevant portion is [this](https://github.com/rust-lang/rust-clippy/compare/master...Areredify:vec_box_threshold?expand=1#diff-1096120ca9143af89dcc9175ea92b54aR294-R298). In hindsight should've been different commits, but oh well.
☀️ Test successful - checks-travis, status-appveyor |
changelog: add size threshold for the
vec_box
lint, currently 4096 bytes (one page) (subject to change). Closes #3547.diff is a little bit confusing due to some refactoring (moving free functions to lint struct functions), relevant portion is this. In hindsight should've been different commits, but oh well.