Skip to content

Commit 9fcb8c1

Browse files
committed
Auto merge of #8279 - illicitonion:bump-semver, r=ehuss
Bump to semver 0.10 for `VersionReq::is_exact` This stops using `to_string` as a proxy for this now-provided precise API. This reverts commit b719272 and bumps the dependency version in Cargo.toml.
2 parents 40d566d + 556c236 commit 9fcb8c1

File tree

8 files changed

+12
-13
lines changed

8 files changed

+12
-13
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ percent-encoding = "2.0"
5252
remove_dir_all = "0.5.2"
5353
rustfix = "0.5.0"
5454
same-file = "1"
55-
semver = { version = "0.9.0", features = ["serde"] }
55+
semver = { version = "0.10", features = ["serde"] }
5656
serde = { version = "1.0.82", features = ["derive"] }
5757
serde_ignored = "0.1.0"
5858
serde_json = { version = "1.0.30", features = ["raw_value"] }

crates/resolver-tests/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,8 @@ fn meta_test_deep_pretty_print_registry() {
734734
"vec![pkg!((\"foo\", \"1.0.1\") => [dep_req(\"bar\", \"^1\"),]),\
735735
pkg!((\"foo\", \"1.0.0\") => [dep_req(\"bar\", \"^2\"),]),\
736736
pkg!((\"foo\", \"2.0.0\") => [dep(\"bar\"),]),\
737-
pkg!((\"bar\", \"1.0.0\") => [dep_req(\"baz\", \"= 1.0.2\"),dep_req(\"other\", \"^1\"),]),\
738-
pkg!((\"bar\", \"2.0.0\") => [dep_req(\"baz\", \"= 1.0.1\"),]),\
737+
pkg!((\"bar\", \"1.0.0\") => [dep_req(\"baz\", \"=1.0.2\"),dep_req(\"other\", \"^1\"),]),\
738+
pkg!((\"bar\", \"2.0.0\") => [dep_req(\"baz\", \"=1.0.1\"),]),\
739739
pkg!((\"baz\", \"1.0.2\") => [dep_req(\"other\", \"^2\"),]),\
740740
pkg!((\"baz\", \"1.0.1\")),\
741741
pkg!((\"cat\", \"1.0.2\") => [dep_req_kind(\"other\", \"^2\", DepKind::Build, false),]),\

src/cargo/core/dependency.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,7 @@ impl Dependency {
393393
/// Returns `true` if this is a "locked" dependency, basically whether it has
394394
/// an exact version req.
395395
pub fn is_locked(&self) -> bool {
396-
// Kind of a hack to figure this out, but it works!
397-
self.inner.req.to_string().starts_with('=')
396+
self.inner.req.is_exact()
398397
}
399398

400399
/// Returns `false` if the dependency is only used to build the local package.

tests/testsuite/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ fn incompatible_dependencies() {
10251025
error: failed to select a version for `bad`.
10261026
... required by package `qux v0.1.0`
10271027
... which is depended on by `foo v0.0.1 ([..])`
1028-
versions that meet the requirements `>= 1.0.1` are: 1.0.2, 1.0.1
1028+
versions that meet the requirements `>=1.0.1` are: 1.0.2, 1.0.1
10291029
10301030
all possible versions conflict with previously selected packages.
10311031
@@ -1070,7 +1070,7 @@ fn incompatible_dependencies_with_multi_semver() {
10701070
"\
10711071
error: failed to select a version for `bad`.
10721072
... required by package `foo v0.0.1 ([..])`
1073-
versions that meet the requirements `>= 1.0.1, <= 2.0.0` are: 2.0.0, 1.0.1
1073+
versions that meet the requirements `>=1.0.1, <=2.0.0` are: 2.0.0, 1.0.1
10741074
10751075
all possible versions conflict with previously selected packages.
10761076

tests/testsuite/install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ fn bad_version() {
175175
.with_stderr(
176176
"\
177177
[UPDATING] [..] index
178-
[ERROR] could not find `foo` in registry `[..]` with version `= 0.2.0`
178+
[ERROR] could not find `foo` in registry `[..]` with version `=0.2.0`
179179
",
180180
)
181181
.run();

tests/testsuite/install_upgrade.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ fn already_installed_updates_yank_status_on_upgrade() {
802802
.with_stderr(
803803
"\
804804
[UPDATING] `[..]` index
805-
[ERROR] could not find `foo` in registry `[..]` with version `= 1.0.1`
805+
[ERROR] could not find `foo` in registry `[..]` with version `=1.0.1`
806806
",
807807
)
808808
.run();

tests/testsuite/registry.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ fn wrong_version() {
223223
.with_status(101)
224224
.with_stderr_contains(
225225
"\
226-
error: failed to select a version for the requirement `foo = \">= 1.0.0\"`
226+
error: failed to select a version for the requirement `foo = \">=1.0.0\"`
227227
candidate versions found which didn't match: 0.0.2, 0.0.1
228228
location searched: `[..]` index (which is replacing registry `[..]`)
229229
required by package `foo v0.0.1 ([..])`
@@ -238,7 +238,7 @@ required by package `foo v0.0.1 ([..])`
238238
.with_status(101)
239239
.with_stderr_contains(
240240
"\
241-
error: failed to select a version for the requirement `foo = \">= 1.0.0\"`
241+
error: failed to select a version for the requirement `foo = \">=1.0.0\"`
242242
candidate versions found which didn't match: 0.0.4, 0.0.3, 0.0.2, ...
243243
location searched: `[..]` index (which is replacing registry `[..]`)
244244
required by package `foo v0.0.1 ([..])`
@@ -543,7 +543,7 @@ fn relying_on_a_yank_is_bad() {
543543
.with_status(101)
544544
.with_stderr_contains(
545545
"\
546-
error: failed to select a version for the requirement `baz = \"= 0.0.2\"`
546+
error: failed to select a version for the requirement `baz = \"=0.0.2\"`
547547
candidate versions found which didn't match: 0.0.1
548548
location searched: `[..]` index (which is replacing registry `[..]`)
549549
required by package `bar v0.0.1`

tests/testsuite/replace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ fn override_wrong_name() {
549549
Caused by:
550550
no matching package for override `[..]baz:0.1.0` found
551551
location searched: file://[..]
552-
version required: = 0.1.0
552+
version required: =0.1.0
553553
",
554554
)
555555
.run();

0 commit comments

Comments
 (0)