-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Optimise Msrv for common one item case #13472
Conversation
r? @Jarcho as they looked into this most recently. |
ca56f4e
to
a83cf35
Compare
I don't see any reason to use |
|
Sorry for the long wait. When I was doing the size in my head I was thinking For memory savings |
I cannot understand what you are saying here, and feel like one of us is confused? This PR swaps If you dislike the complexity this adds, I can do two things:
Or, we can get this merged in as-is with both optimisations. |
My main point is that
My second point was about the actual memory savings. Since Basically don't use |
What are you talking about here?
I am explicitly handling this case https://github.com/GnomedDev/rust-clippy/blob/a83cf350e50ef2b438a02aa17e3980f012e59b65/clippy_config/src/msrvs.rs#L170 Anyway, I'll change it to |
a83cf35
to
d0b15f1
Compare
After a tiny bit of testing, turns out we can fit 2 RustcVersions inline without increasing the inline size, so I did that instead. |
The call to Anyways, thank you. @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Currently,
Msrv
is cloned around a lot in order to handle the#[clippy::msrv]
attribute. This attribute, however, meansRustcVersion
will be heap allocated if there is only one source of an msrv (eg:rust-version
inCargo.toml
).This PR optimizes for said case, while keeping the external interface the same by swapping the internal representation to
SmallVec<[RustcVersion; 2]>
.changelog: none