Skip to content

Releases: natepiano/cargo-mend

cargo-mend v0.15.5

10 Jun 15:24

Choose a tag to compare

Fixed

  • forbidden_pub_crate now suggests pub instead of pub(super) for a pub(crate) item that is exposed only structurally through a reachable public signature (e.g. a type returned by a pub method on a re-exported type); narrowing such an item to pub(super) would have introduced a private_interfaces error.
  • The structural-exposure walk no longer overflows the stack when two public items mention each other in their signatures; visited items are now tracked so the walk terminates.
  • unused_pub no longer flags a type that a trait impl's interface requires, including impls generated by derives (e.g. bevy's AsBindGroup); removing pub from such a type produced E0446 and made cargo mend --fix roll back.
  • Fix --fix rolling back all changes when a call inside mod tests was rewritten with one super:: too few (prefer_module_import). An inline test module sits one level deeper than the file, so reaching the file's parent requires super::super:: — the rewrite now adds one super per nesting level.

cargo-mend v0.15.4

30 May 16:49

Choose a tag to compare

Fixed

  • Disable ANSI color in captured cargo mend output unless color is explicitly forced.
  • prefer_module_import no longer rewrites a function import to use module; when the file already imports that module, which produced a duplicate import (rustc error E0252: the same name imported twice) and forced cargo mend --fix to roll back; the redundant function import is now deleted instead.

cargo-mend v0.15.3

26 May 05:17

Choose a tag to compare

Fixed

  • Fix the install failing to link on Linux with cannot find -lLLVM-*. build.rs now points the linker at the toolchain library directory that holds the bundled LLVM.

cargo-mend v0.15.2

26 May 05:04

Choose a tag to compare

Fixed

  • unused_pub no longer fires on a type reachable only through the return or parameter type of a pub(crate) function whose callers live in another module, which made cargo mend --fix remove a pub that the function signature still needs (E0446).

cargo-mend v0.15.1

25 May 20:49

Choose a tag to compare

Fixed

  • unused_pub no longer fires on a type reachable only through a type alias or another type's public field graph, which made cargo mend --fix remove a pub that a pub(crate) alias still needs (E0446).

cargo-mend v0.15.0

25 May 17:55

Choose a tag to compare

Added

  • Add unused_pub to remove pub from items used only inside their defining module subtree.

Changed

  • Show an interactive progress indicator while fix validation output is suppressed.

cargo-mend v0.14.0

17 May 22:32

Choose a tag to compare

Added

  • Add imports_at_top diagnostic and fix that lifts in-body use statements to the top of their enclosing file or inline module

cargo-mend v0.13.2

15 May 19:23

Choose a tag to compare

Fixed

  • narrow_to_pub_crate no longer fires on a pub item that is publicly reachable through another pub item's signature (e.g. a struct named in a re-exported enum variant's field type, or in a re-exported pub const's type). Suggesting pub(crate) for such items would have introduced a private_interfaces error. The check now mirrors rustc's effective-visibility analysis at Level::Reachable.

cargo-mend v0.13.1

15 May 03:01

Choose a tag to compare

Fixed

  • Fix narrow-pub-crate firing on items reached through pub use when the parent file also contained an earlier pub(crate) use for a sibling

cargo-mend v0.13.0

15 May 01:02

Choose a tag to compare

Changed

  • narrow_to_pub_crate now also fires in nested modules: when an item is
    bare pub and its parent re-exports it as pub(crate) use, cargo mend
    suggests pub(crate) and auto-fixes it. The matching definition-site
    pub(crate) is now permitted at any depth.