File tree Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -323,6 +323,12 @@ impl Dependency {
323
323
self
324
324
}
325
325
326
+ /// Sets the version requirement as any for this dependency.
327
+ pub fn set_version_req_as_any ( & mut self ) -> & mut Dependency {
328
+ Rc :: make_mut ( & mut self . inner ) . req = OptVersionReq :: Any ;
329
+ self
330
+ }
331
+
326
332
pub fn set_platform ( & mut self , platform : Option < Platform > ) -> & mut Dependency {
327
333
Rc :: make_mut ( & mut self . inner ) . platform = platform;
328
334
self
Original file line number Diff line number Diff line change @@ -224,9 +224,8 @@ pub(super) fn activation_error(
224
224
// Maybe the user mistyped the ver_req? Like `dep="2"` when `dep="0.2"`
225
225
// was meant. So we re-query the registry with `dep="*"` so we can
226
226
// list a few versions that were actually found.
227
- let all_req = semver:: VersionReq :: parse ( "*" ) . unwrap ( ) ;
228
227
let mut new_dep = dep. clone ( ) ;
229
- new_dep. set_version_req ( all_req ) ;
228
+ new_dep. set_version_req_as_any ( ) ;
230
229
231
230
let mut candidates = loop {
232
231
match registry. query_vec ( & new_dep, QueryKind :: Exact ) {
Original file line number Diff line number Diff line change @@ -2691,7 +2691,7 @@ fn mismatched_version_with_prerelease() {
2691
2691
. with_stderr (
2692
2692
r#"[UPDATING] `dummy-registry` index
2693
2693
[ERROR] failed to select a version for the requirement `prerelease-deps = "^0.1.0"`
2694
- candidate versions found which didn't match: 0.0.1
2694
+ candidate versions found which didn't match: 0.1.1-pre1, 0. 0.1
2695
2695
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
2696
2696
required by package `foo v0.1.0 [..]`
2697
2697
perhaps a crate was updated and forgotten to be re-vendored?"# ,
Original file line number Diff line number Diff line change @@ -1756,10 +1756,8 @@ fn use_semver_package_incorrectly() {
1756
1756
. with_status ( 101 )
1757
1757
. with_stderr (
1758
1758
"\
1759
- error: no matching package found
1760
- searched package name: `a`
1761
- prerelease package needs to be specified explicitly
1762
- a = { version = \" 0.1.1-alpha.0\" }
1759
+ error: failed to select a version for the requirement `a = \" ^0.1\" `
1760
+ candidate versions found which didn't match: 0.1.1-alpha.0
1763
1761
location searched: [..]
1764
1762
required by package `b v0.1.0 ([..])`
1765
1763
" ,
You can’t perform that action at this time.
0 commit comments