diff --git a/src/doc/man/cargo-tree.md b/src/doc/man/cargo-tree.md index 7a6a8de6b27..06f5af43505 100644 --- a/src/doc/man/cargo-tree.md +++ b/src/doc/man/cargo-tree.md @@ -53,6 +53,23 @@ turn depends on `cfg-if` with "default" features. When using `-e features` it can be helpful to use `-i` flag to show how the features flow into a package. See the examples below for more detail. +### Feature Unification + +This command shows a graph much closer to a feature-unified graph Cargo will +build, rather than what you list in `Cargo.toml`. For instance, if you specify +the same dependency in both `[dependencies]` and `[dev-dependencies]` but with +different features on. This command may merge all features and show a `(*)` on +one of the dependency to indicate the duplicate. + +As a result, for a mostly equivalent overview of what `cargo build` does, +`cargo tree -e normal,build` is pretty close; for a mostly equivalent overview +of what `cargo test` does, `cargo tree` is pretty close. However, it doesn't +guarantee the exact equivalence to what Cargo is going to build, since a +compilation is complex and depends on lots of different factors. + +To learm more about feature unification, check out this +[dedicated section](../reference/features.html#feature-unification). + ## OPTIONS ### Tree Options diff --git a/src/doc/man/generated_txt/cargo-tree.txt b/src/doc/man/generated_txt/cargo-tree.txt index af4a79532a5..53e3833b725 100644 --- a/src/doc/man/generated_txt/cargo-tree.txt +++ b/src/doc/man/generated_txt/cargo-tree.txt @@ -44,6 +44,25 @@ DESCRIPTION it can be helpful to use -i flag to show how the features flow into a package. See the examples below for more detail. + Feature Unification + This command shows a graph much closer to a feature-unified graph Cargo + will build, rather than what you list in Cargo.toml. For instance, if + you specify the same dependency in both [dependencies] and + [dev-dependencies] but with different features on. This command may + merge all features and show a (*) on one of the dependency to indicate + the duplicate. + + As a result, for a mostly equivalent overview of what cargo build does, + cargo tree -e normal,build is pretty close; for a mostly equivalent + overview of what cargo test does, cargo tree is pretty close. However, + it doesn't guarantee the exact equivalence to what Cargo is going to + build, since a compilation is complex and depends on lots of different + factors. + + To learm more about feature unification, check out this dedicated + section + . + OPTIONS Tree Options -i spec, --invert spec diff --git a/src/doc/src/commands/cargo-tree.md b/src/doc/src/commands/cargo-tree.md index 49b531a239c..cd3ae9cc3e9 100644 --- a/src/doc/src/commands/cargo-tree.md +++ b/src/doc/src/commands/cargo-tree.md @@ -53,6 +53,23 @@ turn depends on `cfg-if` with "default" features. When using `-e features` it can be helpful to use `-i` flag to show how the features flow into a package. See the examples below for more detail. +### Feature Unification + +This command shows a graph much closer to a feature-unified graph Cargo will +build, rather than what you list in `Cargo.toml`. For instance, if you specify +the same dependency in both `[dependencies]` and `[dev-dependencies]` but with +different features on. This command may merge all features and show a `(*)` on +one of the dependency to indicate the duplicate. + +As a result, for a mostly equivalent overview of what `cargo build` does, +`cargo tree -e normal,build` is pretty close; for a mostly equivalent overview +of what `cargo test` does, `cargo tree` is pretty close. However, it doesn't +guarantee the exact equivalence to what Cargo is going to build, since a +compilation is complex and depends on lots of different factors. + +To learm more about feature unification, check out this +[dedicated section](../reference/features.html#feature-unification). + ## OPTIONS ### Tree Options diff --git a/src/etc/man/cargo-tree.1 b/src/etc/man/cargo-tree.1 index 8041fe6c4e5..4bd48db8e1b 100644 --- a/src/etc/man/cargo-tree.1 +++ b/src/etc/man/cargo-tree.1 @@ -52,6 +52,21 @@ In this tree, \fBmyproject\fR depends on \fBlog\fR with the \fBserde\fR feature. turn depends on \fBcfg\-if\fR with "default" features. When using \fB\-e features\fR it can be helpful to use \fB\-i\fR flag to show how the features flow into a package. See the examples below for more detail. +.SS "Feature Unification" +This command shows a graph much closer to a feature\-unified graph Cargo will +build, rather than what you list in \fBCargo.toml\fR\&. For instance, if you specify +the same dependency in both \fB[dependencies]\fR and \fB[dev\-dependencies]\fR but with +different features on. This command may merge all features and show a \fB(*)\fR on +one of the dependency to indicate the duplicate. +.sp +As a result, for a mostly equivalent overview of what \fBcargo build\fR does, +\fBcargo tree \-e normal,build\fR is pretty close; for a mostly equivalent overview +of what \fBcargo test\fR does, \fBcargo tree\fR is pretty close. However, it doesn't +guarantee the exact equivalence to what Cargo is going to build, since a +compilation is complex and depends on lots of different factors. +.sp +To learm more about feature unification, check out this +\fIdedicated section\fR \&. .SH "OPTIONS" .SS "Tree Options" .sp