Skip to content

Commit

Permalink
Merge pull request #3890 from rust-lang/push-vmxrspyskulq
Browse files Browse the repository at this point in the history
Ch. 14: clarify workspace dependency reuse
  • Loading branch information
chriskrycho authored Apr 19, 2024
2 parents 50149d9 + 1221096 commit 0bcde15
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ch14-03-cargo-workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,15 @@ error[E0432]: unresolved import `rand`
To fix this, edit the *Cargo.toml* file for the `adder` package and indicate
that `rand` is a dependency for it as well. Building the `adder` package will
add `rand` to the list of dependencies for `adder` in *Cargo.lock*, but no
additional copies of `rand` will be downloaded. Cargo has ensured that every
additional copies of `rand` will be downloaded. Cargo will ensure that every
crate in every package in the workspace using the `rand` package will be using
the same version, saving us space and ensuring that the crates in the workspace
will be compatible with each other.
the same version as long as they specify compatible versions of `rand`, saving
us space and ensuring that the crates in the workspace will be compatible with
each other.

If crates in the workspace specify incompatible versions of the same dependency,
Cargo will resolve each of them, but will still try to resolve as few versions
as possible.

#### Adding a Test to a Workspace

Expand Down

0 comments on commit 0bcde15

Please sign in to comment.