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

Make VEC_BOX lint configurable over the size of T #3547

Closed
flip1995 opened this issue Dec 14, 2018 · 1 comment · Fixed by #5081
Closed

Make VEC_BOX lint configurable over the size of T #3547

flip1995 opened this issue Dec 14, 2018 · 1 comment · Fixed by #5081
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages good-first-issue These issues are a good way to get started with Clippy

Comments

@flip1995
Copy link
Member

In #3545 the VEC_BOX lint was implemented. This lints on usage of Vec<Box<T: Sized>> . The Box around T could make sense though, if T is a very large type. (See also #3530 (comment))

A good enhancement for this lint would be, to make it configurable over the size of T, with some meaningful default value (TBD).

@flip1995 flip1995 added good-first-issue These issues are a good way to get started with Clippy C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages labels Dec 14, 2018
@udoprog
Copy link

udoprog commented Nov 8, 2019

Just wanted to echo this. I'm storing a lot of large objects in a Vec (~32G in total) and in order to meet memory constraints they need to be boxed. When the vector is at capacity requires the next capacity's worth of contiguous memory to move the values into. Also shuffling the pointers around has proven to be much more efficient.

So the vec_box lint is very noisy for me. Preferably I'd like to be able to mark the contained types for which it should be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages good-first-issue These issues are a good way to get started with Clippy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants