File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,7 +52,8 @@ Examples:
5252
5353There can be false positives when depending on a transitive dependency to activate a feature.
5454
55- There an be false positives when pinning the version of a transitive dependency in `Cargo.toml`.
55+ For false positives from pinning the version of a transitive dependency in `Cargo.toml`,
56+ move the dependency to the `target."cfg(false)".dependencies` table.
5657
5758### Example
5859
Original file line number Diff line number Diff line change @@ -450,7 +450,8 @@ Examples:
450450
451451There can be false positives when depending on a transitive dependency to activate a feature.
452452
453- There an be false positives when pinning the version of a transitive dependency in ` Cargo.toml ` .
453+ For false positives from pinning the version of a transitive dependency in ` Cargo.toml ` ,
454+ move the dependency to the ` target."cfg(false)".dependencies ` table.
454455
455456### Example
456457
Original file line number Diff line number Diff line change @@ -1212,6 +1212,8 @@ fn pinned_transitive_dep() {
12121212
12131213 [dependencies]
12141214 intermediate = "0.1.0"
1215+
1216+ [target."cfg(false)".dependencies]
12151217 transitive = "=0.1.1"
12161218
12171219 [lints.cargo]
@@ -1237,17 +1239,6 @@ fn pinned_transitive_dep() {
12371239[CHECKING] transitive v0.1.1
12381240[CHECKING] intermediate v0.1.0
12391241[CHECKING] foo v0.1.0 ([ROOT]/foo)
1240- [WARNING] unused dependency
1241- --> Cargo.toml:10:13
1242- |
1243- 10 | transitive = "=0.1.1"
1244- | ^^^^^^^^^^^^^^^^^^^^^
1245- |
1246- = [NOTE] `cargo::unused_dependencies` is set to `warn` by default
1247- [HELP] remove the dependency
1248- |
1249- 10 - transitive = "=0.1.1"
1250- |
12511242[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
12521243
12531244"# ] ] )
You can’t perform that action at this time.
0 commit comments