Login
You're viewing the techdon.dev public feed.

Replies

  • May 8, 2026, 11:56 PM

    @epage

    I wonder if it's possible to also detect unused features.

    Some features don't add any items, only change existing items' behavior, so this may be impossible. Sure would be neat, though.

    💬 1🔄 0⭐ 0
  • May 9, 2026, 12:09 AM

    @argv_minus_one One approach would be a cross crate used/unused pub item tracking with what cfgs the item has. Cargo could then report if all pub items for a feature are unused. This would only have false positives for features that are both behavior changes and API additions.

    This would also be useful for workspace-private crates for detecting unused code.

    I'm assuming this would be expensive to track, including the serializing and deserializing of intermediate state between rustc and cargo.

    💬 0🔄 0⭐ 0