Skip to content

Commit 7997306

Browse files
committed
restore error message
1 parent 2352cbd commit 7997306

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

src/cargo/util/semver_ext.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,6 @@ impl OptVersionReq {
7676
}
7777

7878
pub fn update_precise(&mut self, version: &Version) {
79-
assert!(
80-
self.matches(version),
81-
"cannot update_precise {} to {}",
82-
self,
83-
version
84-
);
8579
use OptVersionReq::*;
8680
let version = version.clone();
8781
*self = match self {

tests/testsuite/update.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,14 @@ fn update_precise_mismatched() {
417417

418418
// `1.6.0` does not match `"~1.2"`
419419
p.cargo("update serde:1.2 --precise 1.6.0")
420-
// This terrible error message was a regression in #12749
421420
.with_stderr(
422421
"\
423422
[UPDATING] `[..]` index
424-
thread 'main' panicked at src/cargo/util/semver_ext.rs:79:9:
425-
cannot update_precise ~1.2 to 1.6.0
426-
[..]
423+
[ERROR] failed to select a version for the requirement `serde = \"~1.2\"`
424+
candidate versions found which didn't match: 1.6.0
425+
location searched: `[..]` index (which is replacing registry `crates-io`)
426+
required by package `bar v0.0.1 ([..]/foo)`
427+
perhaps a crate was updated and forgotten to be re-vendored?
427428
",
428429
)
429430
.with_status(101)
@@ -434,11 +435,11 @@ cannot update_precise ~1.2 to 1.6.0
434435
// This terrible error message has been the same for a long time. A fix is more than welcome!
435436
.with_stderr(
436437
"\
437-
[UPDATING] `[..]` index
438-
[ERROR] no matching package named `serde` found
439-
location searched: registry `crates-io`
440-
required by package `bar v0.0.1 ([..]/foo)`
441-
",
438+
[UPDATING] `[..]` index
439+
[ERROR] no matching package named `serde` found
440+
location searched: registry `crates-io`
441+
required by package `bar v0.0.1 ([..]/foo)`
442+
",
442443
)
443444
.with_status(101)
444445
.run();

0 commit comments

Comments
 (0)