Skip to content

Commit 41d157e

Browse files
committed
docs(ref): Have workspace docs link out to patch/replace docs
The workspace behavior doesn't seem to be documented at all, so a blurb was brought in that is like the profile blurb. The workspace docs then link out to it so users can be aware of this special workspace behavior.
1 parent d3f3dd5 commit 41d157e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ also be patched with versions of crates that already exist. If a source is
291291
patched with a crate version that already exists in the source, then the
292292
source's original crate is replaced.
293293

294+
Cargo only looks at the patch settings in the `Cargo.toml` manifest at the
295+
root of the workspace. Patch settings defined in dependencies will be
296+
ignored.
297+
294298
### The `[replace]` section
295299

296300
> **Note**: `[replace]` is deprecated. You should use the
@@ -313,6 +317,10 @@ dependencies, except that you can't specify features. Note that when a crate
313317
is overridden the copy it's overridden with must have both the same name and
314318
version, but it can come from a different source (e.g., git or a local path).
315319

320+
Cargo only looks at the replace settings in the `Cargo.toml` manifest at the
321+
root of the workspace. Replace settings defined in dependencies will be
322+
ignored.
323+
316324
### `paths` overrides
317325

318326
Sometimes you're only temporarily working on a crate and you don't want to have

src/doc/src/reference/workspaces.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ In the `Cargo.toml`, the `[workspace]` table supports the following sections:
2525
* [`metadata`](#the-metadata-table) — Extra settings for external tools.
2626
* [`package`](#the-package-table) — Keys for inheriting in packages.
2727
* [`dependencies`](#the-dependencies-table) — Keys for inheriting in package dependencies.
28+
* [`[patch]`](overriding-dependencies.md#the-patch-section) — Override dependencies.
29+
* [`[replace]`](overriding-dependencies.md#the-replace-section) — Override dependencies (deprecated).
2830
* [`[profile]`](profiles.md) — Compiler settings and optimizations.
2931

3032
### The `[workspace]` section

0 commit comments

Comments
 (0)