Skip to content

v0.39.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 28 Jan 16:00
· 11 commits to main since this release
a278f1d

In this release

  • 20 new lints, for a total of 127!
  • Spotlight: Merging into cargo

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

Spotlight: Merging into cargo

While cargo-semver-checks is currently a standalone tool, Rust's cargo team plans to eventually make it a built-in part of cargo itself. Here's how that would work.

When users run cargo publish today, cargo first runs a series of checks to make sure everything is in order. For example, it ensures that the code repository doesn't include any uncommitted changes, so as not to accidentally publish uncommitted code to crates.io:

$ cargo publish
    Updating crates.io index
error: 1 files in the working directory contain changes that were not yet committed into git:

src/lib.rs

to proceed despite this and include the uncommitted changes, pass the `--allow-dirty` flag

cargo-semver-checks is planned to become another such pre-publish check, equivalent to running cargo semver-checks && cargo publish today. Of course, there are situations where maintainers may prefer to intentionally publish breaking changes in a non-major version, such as for a sufficiently critical security fix. The automatic semver-check will be overridable by passing a flag analogous to the --allow-dirty flag for uncommitted changes.

While we're excited to merge cargo-semver-checks into cargo, we are proceeding with caution before enabling it by default. We want to ensure "merge day" is a day of celebration for the entire Rust community, instead of causing frustration and further breakage! Good news: you can help us do that! Consider:

New lints

Preventing breakage caused by changes in generic parameters (lifetimes, const generics, and generic types), changes in package features, union field changes, and more:

  • feature_not_enabled_by_default
  • function_abi_now_unwind
  • function_requires_different_const_generic_params
  • function_requires_different_generic_type_params
  • method_requires_different_const_generic_params
  • method_requires_different_generic_type_params
  • proc_macro_now_doc_hidden
  • trait_allows_fewer_const_generic_params
  • trait_allows_fewer_generic_type_params
  • trait_method_parameter_count_changed
  • trait_method_requires_different_const_generic_params
  • trait_method_requires_different_generic_type_params
  • trait_requires_more_const_generic_params
  • trait_requires_more_generic_type_params
  • type_allows_fewer_const_generic_params
  • type_allows_fewer_generic_type_params
  • type_requires_more_const_generic_params
  • type_requires_more_generic_type_params
  • union_field_added_with_all_pub_fields
  • union_field_added_with_non_pub_fields

Additionally, we've renamed one lint to align with the shift in preferred Rust terminology:

  • trait_no_longer_object_safe -> trait_no_longer_dyn_compatible

Thanks to @Frank-III for contributing lints to this release!

All merged PRs

New Contributors

Full Changelog: v0.38.0...v0.39.0