Skip to content

Commit

Permalink
docs(ref): Have workspace docs link out to patch/replace docs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
epage committed Sep 13, 2022
1 parent f611d7d commit bd72af8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/doc/src/reference/overriding-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ also be patched with versions of crates that already exist. If a source is
patched with a crate version that already exists in the source, then the
source's original crate is replaced.

Cargo only looks at the patch settings in the `Cargo.toml` manifest at the
root of the workspace. Patch settings defined in dependencies will be
ignored.

### The `[replace]` section

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

Cargo only looks at the replace settings in the `Cargo.toml` manifest at the
root of the workspace. Replace settings defined in dependencies will be
ignored.

### `paths` overrides

Sometimes you're only temporarily working on a crate and you don't want to have
Expand Down
2 changes: 2 additions & 0 deletions src/doc/src/reference/workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ The `[workspace]` table supports the following sections:
* [`metadata`](#the-metadata-table) — Extra settings for external tools.
* [`package`](#the-package-table) — Keys for inheriting in packages.
* [`dependencies`](#the-dependencies-table) — Keys for inheriting in package dependencies.
* [`[patch]`](overriding-dependencies.md#the-patch-section) — Override dependencies.
* [`[replace]`](overriding-dependencies.md#the-replace-section) — Override dependencies (deprecated).
* [`[profile]`](profiles.md) — Compiler settings and optimizations.

### The `[workspace]` section
Expand Down

0 comments on commit bd72af8

Please sign in to comment.