In this release
- 12 new lints, for a total of 106!
- Bugfix for packages using the "SemVer trick"
- Spotlight: Performance via parallelism
This release requires Rust 1.81+ both to install (MSRV) and at runtime.
Spotlight: Performance via parallelism
cargo-semver-checks
is on a trajectory of doubling its number of lints every year. But more lints mean more code scanning work to be done! And nobody likes slow tools, so we had to parallelize!
We began taking a serious look at performance in early 2023. Compared to that point ~almost two years ago:
- Lint checking time has reduced by 20%, in wall-clock terms & measured on the exact same hardware.
- Yet, we run over 2.5x as many lints in that time!
We've aimed to parallelize as much of the execution of the tool as possible, with help from the rayon
library. Today, both the lint execution and the rustdoc indexing steps use rayon
to distribute the work across all available cores on your system. In practice, this ~halved linting time on the default GitHub Actions runners (which have only 2 cores), and it has an even bigger impact on more powerful hardware.
Parallelism is one of many tricks we employ to keep cargo-semver-checks
fast while it's gaining ever more lints. More on this in future Spotlights!
New lints
Preventing breakage caused by macros, enum discriminants, mutable statics, and generic lifetime parameters:
function_like_proc_macro_missing
attribute_proc_macro_missing
derive_proc_macro_missing
derive_helper_attr_removed
macro_now_doc_hidden
macro_no_longer_exported
enum_repr_variant_discriminant_changed
enum_discriminants_undefined_non_exhaustive_variant
enum_discriminants_undefined_non_unit_variant
pub_static_now_mutable
type_mismatched_generic_lifetimes
trait_mismatched_generic_lifetimes
Thanks to @malenaohl and @orhun for contributing lints to this release!
Bugfix for self-referential crates
Crates that are about to release a new major version often use the "SemVer trick" to make the upgrade process more ergonomic for their users. This involves making the crate list a "future" version of itself as a dependency, which is quite unusual otherwise!
Unfortunately, this leads to having two packages by the same name in the dependency tree, which confused the new feature-scanning code shipped in cargo-semver-checks
v0.37. The resulting crash was reported by @jonathanpallant, and is now fixed! Enjoy!
All merged PRs
- Drop support for Rust 1.80. by @obi1kenobi in #1018
- Test that externally-defined functions going safe -> unsafe are caught. by @obi1kenobi in #1003
- Update to latest major versions of dependencies. by @obi1kenobi in #1014
- Suggest generating test rustdocs while reading the guide. by @obi1kenobi in #1019
- feat: add pub_static_now_mutable lint by @orhun in #1020
- Ignore .DS_Store files. by @obi1kenobi in #1022
- The macOS
head
binary doesn't support-1
so switch tosed
. by @obi1kenobi in #1023 - Make
sed
invocation truly portable across macOS and Linux. by @obi1kenobi in #1024 - Remove more kinds of
cargo
output related to blocking on file locks. by @obi1kenobi in #1025 - Add function_like_proc_macro_missing lint by @malenaohl in #1021
- Add lint attribute_proc_macro_missing by @malenaohl in #1026
- Add lint derive_proc_macro_missing by @malenaohl in #1027
- Add lint derive_helper_attr_removed by @malenaohl in #1028
- Add lint macro_now_doc_hidden by @malenaohl in #1029
- Fix typo in
declarative_macro_missing
lint. by @obi1kenobi in #1030 - Add new lint macro_no_longer_exported by @malenaohl in #1031
- Weekly
cargo update
of dependencies by @obi1kenobi in #1033 - Report the root cause of non-fatal errors. by @obi1kenobi in #1034
- Ensure metadata of self-referential crates can be read. by @obi1kenobi in #1035
- Add the
enum_repr_variant_discriminant_changed
lint. by @obi1kenobi in #1036 - Add two lints for cases where enum discriminants are no longer defined. by @obi1kenobi in #1037
- Add
compile_fail
to ensure doctests pass in the new test crate. by @obi1kenobi in #1038 - Add
type_mismatched_generic_lifetimes
lint. by @obi1kenobi in #1039 - Add
trait_mismatched_generic_lifetimes
lint. by @obi1kenobi in #1040 - Release v0.38 with a dozen new lints and a fix for metadata linting. by @obi1kenobi in #1041
New Contributors
- @orhun made their first contribution in #1020
- @malenaohl made their first contribution in #1021
Full Changelog: v0.37.0...v0.38.0