Skip to content

v0.38.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 11 Dec 16:24
· 18 commits to main since this release
b9709e6

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

New Contributors

Full Changelog: v0.37.0...v0.38.0