Skip to content

Commit

Permalink
docs(resolver): Move all constraints under one header
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Oct 9, 2024
1 parent 8e872ac commit f147d52
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/doc/src/reference/resolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ resolver.
[dependency specification]: specifying-dependencies.md
[`cargo tree`]: ../commands/cargo-tree.md

## SemVer compatibility
## Constraints and Heuristics

### SemVer compatibility

Cargo uses [SemVer] for specifying version numbers. This establishes a common
convention for what is compatible between different versions of a package. See
Expand Down Expand Up @@ -151,7 +153,7 @@ the `0.4` release of the `log` package.
[SemVer Compatibility]: semver.md
[Version-incompatibility hazards]: #version-incompatibility-hazards

### Version-incompatibility hazards
#### Version-incompatibility hazards

When multiple versions of a crate appear in the resolve graph, this can cause
problems when types from those crates are exposed by the crates using them.
Expand Down Expand Up @@ -186,12 +188,6 @@ ecosystem if you publish a SemVer-incompatible version of a popular library.
[semver trick]: https://github.com/dtolnay/semver-trick
[`downcast_ref`]: ../../std/any/trait.Any.html#method.downcast_ref

## Other constraints

Version requirements aren't the only constraint that the resolver considers
when selecting and unifying dependencies. The following sections cover some of
the other constraints that can affect resolution.

### Features

For the purpose of generating `Cargo.lock`, the resolver builds the dependency
Expand Down Expand Up @@ -611,6 +607,7 @@ circumstances:
var fragments = {
"#version-metadata": "specifying-dependencies.html#version-metadata",
"#pre-releases": "specifying-dependencies.html#pre-releases",
"#other-constraints": "#constraints-and-heuristics",
};
var target = fragments[window.location.hash];
if (target) {
Expand Down

0 comments on commit f147d52

Please sign in to comment.