Skip to content

v0.40.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 08 Mar 16:34
· 6 commits to main since this release
d29a72f

In this release

  • 21 new lints, for a total of 148!
  • Spotlight: #[doc(hidden)] and sealed lints

This release requires Rust 1.83+ both to install (MSRV) and at runtime. Future releases will require Rust 1.84+.

Spotlight: #[doc(hidden)] and sealed lints

When is "this trait can be implemented" part of the trait's public API?

At a high level, the answer is: when writing an impl of that trait for our own type doesn't require using any #[doc(hidden)] items. But you've been following cargo-semver-checks long enough to know the full answer is much more complex. And getting the right answer here affects the correctness of a ton of lints!

Good news! This cargo-semver-checks release ships with a much more sophisticated system for analyzing whether traits can be implemented or are instead "sealed." The new system is more thorough, more nuanced, and faster to boot!

Read more about it here: https://predr.ag/blog/when-is-trait-can-be-implemented-public-api/

New lints

We added new 21 lints across several categories. Some of the new lints are error-by-default, while others are merely warnings meant to flag changes deserving closer review.

API breakage:

  • static_became_unsafe

ABI and FFI breakage due to changed repr(C) type layout:

  • repr_c_enum_struct_variant_fields_reordered
  • repr_c_plain_struct_fields_reordered

Item deprecations, which cause lints in downstream use:

  • function_marked_deprecated
  • global_value_marked_deprecated
  • macro_marked_deprecated
  • proc_macro_marked_deprecated
  • struct_field_marked_deprecated
  • trait_associated_const_marked_deprecated
  • trait_associated_type_marked_deprecated
  • trait_marked_deprecated
  • trait_method_marked_deprecated
  • type_associated_const_marked_deprecated
  • type_method_marked_deprecated

Code behavior changes, such as changes to sort order of existing types:

  • partial_ord_enum_struct_variant_fields_reordered
  • partial_ord_enum_variants_reordered
  • partial_ord_struct_fields_reordered

Compatibility risks, such as changes that may require a SemVer major bump to revert, or may otherwise represent unintended API changes without being SemVer-major themselves:

  • pub_api_sealed_trait_became_unconditionally_sealed
  • unconditionally_sealed_trait_became_pub_api_sealed
  • unconditionally_sealed_trait_became_unsealed
  • pub_api_sealed_trait_became_unsealed

Thanks to @Frank-III, @geetanshjuneja, and @lovelindhoni for contributing lints to this release!

All merged PRs

New Contributors

Full Changelog: v0.39.0...v0.40.0