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 {
323323 self
324324 }
325325
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+
326332 pub fn set_platform ( & mut self , platform : Option < Platform > ) -> & mut Dependency {
327333 Rc :: make_mut ( & mut self . inner ) . platform = platform;
328334 self
Original file line number Diff line number Diff line change @@ -224,9 +224,8 @@ pub(super) fn activation_error(
224224 // Maybe the user mistyped the ver_req? Like `dep="2"` when `dep="0.2"`
225225 // was meant. So we re-query the registry with `dep="*"` so we can
226226 // list a few versions that were actually found.
227- let all_req = semver:: VersionReq :: parse ( "*" ) . unwrap ( ) ;
228227 let mut new_dep = dep. clone ( ) ;
229- new_dep. set_version_req ( all_req ) ;
228+ new_dep. set_version_req_as_any ( ) ;
230229
231230 let mut candidates = loop {
232231 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() {
26912691 . with_stderr (
26922692 r#"[UPDATING] `dummy-registry` index
26932693[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
26952695location searched: `dummy-registry` index (which is replacing registry `crates-io`)
26962696required by package `foo v0.1.0 [..]`
26972697perhaps 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() {
17561756 . with_status ( 101 )
17571757 . with_stderr (
17581758 "\
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
17631761location searched: [..]
17641762required by package `b v0.1.0 ([..])`
17651763" ,
You can’t perform that action at this time.
0 commit comments