How to discover crate features in Rust 1.74

There is a change in cargo with Rust 1.74. If you add a dependency via "crate add", not all features are displayed anymore - if there are too many features.

Details are discussed here:

All you get is the number of deactivated features. (example below)

I understand that so far. But what is the best and most convenient way to check the features of the added crate?

$ cargo add sqlx
    Updating index
      Adding sqlx v0.7.2 to dependencies.
             + any
             + json
             + macros
             + migrate
             + sqlx-macros
             28 deactivated features
    Updating index
1 Like

One way is to check on the excellent website: Feature flags of SQLx crate.

It's outside the cargo add workflow though, so it's probably not what you were looking for.


The basic source of truth is always a package's Cargo.toml file, as that is where features are declared (i.e. Rust code only uses already-declared features).
So that's always an option.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.