-
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 to unecessary_box_returns #10651
Conversation
r? @xFrednet (rustbot has picked a reviewer for you, use r? to override) |
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.
LGTM, tiny nit related to the lint documentation comment. It requires some specific syntax. :)
clippy_lints/src/utils/conf.rs
Outdated
@@ -463,6 +463,10 @@ define_Conf! { | |||
/// | |||
/// The maximum byte size a `Future` can have, before it triggers the `clippy::large_futures` lint | |||
(future_size_threshold: u64 = 16 * 1024), | |||
/// Lint: UNNECESSARY_BOX_RETURNS, |
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: UNNECESSARY_BOX_RETURNS, | |
/// Lint: UNNECESSARY_BOX_RETURNS. |
This list requires a dot at the end, to be parsed correctly. Once you do this, you also have to run cargo collect-matadata
to update the lint configuration list in our book.
Thank you! You can @bors delegate+ |
✌️ @lukaslueg can now approve this pull request |
@bors r=xFrednet |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Fixes #10641
This adds a configuration-knob to the
unecessary_box_returns
-lint which allows not linting afn() -> Box<T>
ifT
is "large". The default byte size above which we no longer lint is 128 bytes (due to #4652 (comment), also used in #9373). The overall rational is given in #10641.changelog: Enhancement: [
unnecessary_box_returns
]: Added new lint configurationunnecessary-box-size
to set the maximum size ofT
inBox<T>
to be linted#10651