Skip to content

Commit

Permalink
Auto merge of #9120 - dimo414:patch-1, r=alexcrichton
Browse files Browse the repository at this point in the history
Flip 'foo' and 'bar' to be consistent

The "Renaming dependencies" section initially uses 'foo' as the crate name and 'bar' as a rename, but then swaps them and uses 'bar' as the example crate name in the context of optional dependencies. Now both examples in this section treat 'foo' as the original crate name.
  • Loading branch information
bors committed Feb 1, 2021
2 parents c5f7fa1 + 2663d7d commit 4e4490f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/doc/src/reference/specifying-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,19 +429,19 @@ Note that if you have an optional dependency like:

```toml
[dependencies]
foo = { version = "0.1", package = 'bar', optional = true }
bar = { version = "0.1", package = 'foo', optional = true }
```

you're depending on the crate `bar` from crates.io, but your crate has a `foo`
feature instead of a `bar` feature. That is, names of features take after the
you're depending on the crate `foo` from crates.io, but your crate has a `bar`
feature instead of a `foo` feature. That is, names of features take after the
name of the dependency, not the package name, when renamed.

Enabling transitive dependencies works similarly, for example we could add the
following to the above manifest:

```toml
[features]
log-debug = ['foo/log-debug'] # using 'bar/log-debug' would be an error!
log-debug = ['bar/log-debug'] # using 'foo/log-debug' would be an error!
```

[crates.io]: https://crates.io/
Expand Down

0 comments on commit 4e4490f

Please sign in to comment.