mirror of
https://github.com/rust-lang/cargo
synced 2024-11-05 18:50:39 +00:00
doc: fix some stale URLs
This commit is contained in:
parent
7039064d5b
commit
ec3909e254
3 changed files with 9 additions and 7 deletions
|
@ -20,11 +20,11 @@ use. This example adds a dependency of the `time` crate:
|
||||||
time = "0.1.12"
|
time = "0.1.12"
|
||||||
```
|
```
|
||||||
|
|
||||||
The version string is a [semver] version requirement. The [specifying
|
The version string is a [SemVer] version requirement. The [specifying
|
||||||
dependencies](../reference/specifying-dependencies.md) docs have more information about
|
dependencies](../reference/specifying-dependencies.md) docs have more information about
|
||||||
the options you have here.
|
the options you have here.
|
||||||
|
|
||||||
[semver]: https://github.com/steveklabnik/semver#requirements
|
[SemVer]: https://semver.org
|
||||||
|
|
||||||
If we also wanted to add a dependency on the `regex` crate, we would not need
|
If we also wanted to add a dependency on the `regex` crate, we would not need
|
||||||
to add `[dependencies]` for each crate listed. Here's what your whole
|
to add `[dependencies]` for each crate listed. Here's what your whole
|
||||||
|
|
|
@ -222,9 +222,9 @@ explaining the format of the entry.
|
||||||
// this is the new name. The original package name is stored in
|
// this is the new name. The original package name is stored in
|
||||||
// the `package` field.
|
// the `package` field.
|
||||||
"name": "rand",
|
"name": "rand",
|
||||||
// The semver requirement for this dependency.
|
// The SemVer requirement for this dependency.
|
||||||
// This must be a valid version requirement defined at
|
// This must be a valid version requirement defined at
|
||||||
// https://github.com/steveklabnik/semver#requirements.
|
// https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html.
|
||||||
"req": "^0.6",
|
"req": "^0.6",
|
||||||
// Array of features (as strings) enabled for this dependency.
|
// Array of features (as strings) enabled for this dependency.
|
||||||
"features": ["i128_support"],
|
"features": ["i128_support"],
|
||||||
|
|
|
@ -21,7 +21,7 @@ time = "0.1.12"
|
||||||
|
|
||||||
The string `"0.1.12"` is a version requirement. Although it looks like a
|
The string `"0.1.12"` is a version requirement. Although it looks like a
|
||||||
specific *version* of the `time` crate, it actually specifies a *range* of
|
specific *version* of the `time` crate, it actually specifies a *range* of
|
||||||
versions and allows SemVer compatible updates. An update is allowed if the new
|
versions and allows [SemVer] compatible updates. An update is allowed if the new
|
||||||
version number does not modify the left-most non-zero digit in the major, minor,
|
version number does not modify the left-most non-zero digit in the major, minor,
|
||||||
patch grouping. In this case, if we ran `cargo update -p time`, cargo should
|
patch grouping. In this case, if we ran `cargo update -p time`, cargo should
|
||||||
update us to version `0.1.13` if it is the latest `0.1.z` release, but would not
|
update us to version `0.1.13` if it is the latest `0.1.z` release, but would not
|
||||||
|
@ -29,6 +29,8 @@ update us to `0.2.0`. If instead we had specified the version string as `1.0`,
|
||||||
cargo should update to `1.1` if it is the latest `1.y` release, but not `2.0`.
|
cargo should update to `1.1` if it is the latest `1.y` release, but not `2.0`.
|
||||||
The version `0.0.x` is not considered compatible with any other version.
|
The version `0.0.x` is not considered compatible with any other version.
|
||||||
|
|
||||||
|
[SemVer]: https://semver.org
|
||||||
|
|
||||||
Here are some more examples of version requirements and the versions that would
|
Here are some more examples of version requirements and the versions that would
|
||||||
be allowed with them:
|
be allowed with them:
|
||||||
|
|
||||||
|
@ -48,8 +50,8 @@ versions before 1.0.0. While SemVer says there is no compatibility before
|
||||||
1.0.0, Cargo considers `0.x.y` to be compatible with `0.x.z`, where `y ≥ z`
|
1.0.0, Cargo considers `0.x.y` to be compatible with `0.x.z`, where `y ≥ z`
|
||||||
and `x > 0`.
|
and `x > 0`.
|
||||||
|
|
||||||
It is possible to further tweak the logic for selecting compatible version using
|
It is possible to further tweak the logic for selecting compatible versions
|
||||||
special operators, though it shouldn't be necessary most of the time.
|
using special operators, though it shouldn't be necessary most of the time.
|
||||||
|
|
||||||
### Caret requirements
|
### Caret requirements
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue