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
Ensure the lint files are part of the binary file itself. #234
Conversation
What :O |
I see. Have you already thought about possible tests that could catch this? |
I know, right? At compile-time, I found it this by accident while testing something else with the locally-built binary for the newest version, so we got lucky. Otherwise, I think this would have made it through our entire release process and would have broken our users. It's probably a good idea to add a CI check that does |
Would you be interested in adding that CI check, or should I go for it? |
// No way to avoid this lint -- the push() calls are macro-generated. | ||
#[allow(clippy::vec_init_then_push)] |
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.
Is that a new clippy lint? Should I update my clippy?
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.
I don't think it's new, it's been there since 1.51 per this page: https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
The old code didn't trigger that lint for me, though. Not sure why only the new code gets it.
I can try doing that this week. Will you create an appropriate issue? |
As part of the
add_lints!()
macro, we had accidentally made the lints no longer be part of thecargo-semver-checks
binary itself. This means that everything worked fine as long as it was run from thecargo-semver-checks
repo itself, and failed spectacularly as soon as that was not the case (e.g. aftercargo install cargo-semver-checks
).This PR re-adds the lints into the binary using
include_str!()
.