Skip to content

Highlight enables features in cargo info

Open

Description

Problem

As described in #14141, the following thing should be displayed for features:

  • For features enabled by users, a + prefix and colored output are now used for better visibility.
  • For features enabled automatically, colored output is used to distinguish them.
  • For disabled features, non-colored output is used to clearly indicate their status.

The enabled/disabled features are ignored in the cargo info output. There is always just a "+" for default features. Enabled features via Cargo.toml are not displayed as enabled.

Steps

$ grep "^reqwest =" Cargo.toml
reqwest = { version = "*", features = ["blocking", "json", "cookies", "rustls-tls-native-roots"], default-features = false }
$ cargo +nightly info reqwest
reqwest #http #request #client
higher level HTTP client library
version: 0.12.8
license: MIT OR Apache-2.0
rust-version: 1.63.0
documentation: https://docs.rs/reqwest
repository: https://github.com/seanmonstar/reqwest
crates.io: https://crates.io/crates/reqwest/0.12.8
features:
 +default                             = [default-tls, charset, http2, macos-system-configuration]
  __tls                               = [dep:rustls-pemfile, tokio/io-util]
  charset                             = [dep:encoding_rs]
  default-tls                         = [dep:hyper-tls, dep:native-tls-crate, __tls, dep:tokio-native-tls]
  h2                                  = [dep:h2]
  http2                               = [h2, hyper/http2, hyper-util/http2, hyper-rustls?/http2]
  macos-system-configuration          = [dep:system-configuration]
  25 deactivated features
note: to see how you depend on reqwest, run `cargo tree --invert --package [email protected]`

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.83.0-nightly (80d82ca 2024-09-27)
release: 1.83.0-nightly
commit-hash: 80d82ca
commit-date: 2024-09-27
host: x86_64-unknown-linux-gnu
libgit2: 1.8.1 (sys:0.19.0 vendored)
libcurl: 8.9.0-DEV (sys:0.4.74+curl-8.9.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w 11 Sep 2023
os: Fedora 41.0.0 (FortyOne) [64-bit]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: enhancementCategory: enhancementCommand-infoS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions