Skip to content

Commit b1dd22e

Browse files
committed
Auto merge of #10836 - ehuss:patch-config-docs, r=weihanglo
Mention `[patch]` config in "Overriding Dependencies" The "Overriding Dependencies" chapter is the primary documentation for the `[patch]` table, but it does not mention that `[patch]` also works in config files. This adds a note to mention this option. cc #10832 (comment)
2 parents f4fad79 + 1ac40e2 commit b1dd22e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/doc/src/reference/overriding-dependencies.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ git = 'https://github.com/example/baz'
266266
baz = { git = 'https://github.com/example/patched-baz', branch = 'my-branch' }
267267
```
268268

269+
> **Note**: The `[patch]` table can also be specified as a [configuration
270+
> option](config.md), such as in a `.cargo/config.toml` file or a CLI option
271+
> like `--config 'patch.crates-io.rand.path="rand"'`. This can be useful for
272+
> local-only changes that you don't want to commit, or temporarily testing a
273+
> patch.
274+
269275
The `[patch]` table is made of dependency-like sub-tables. Each key after
270276
`[patch]` is a URL of the source that is being patched, or the name of a
271277
registry. The name `crates-io` may be used to override the default registry

0 commit comments

Comments
 (0)