Skip to content

Commit 44277a4

Browse files
authored
docs(ref): Mention x.y.* as a kind of version requirement to avoid. (#15310)
This expands the text introduced by #12323. `x.y.*` is equivalent to `>=x.y.0, <x.(y+1).0`, so it can create an unresolvable conflict in the same way as already discussed. I also added a little punctuation to improve the structure of some nearby sentences. @rustbot label A-documenting-cargo-itself
2 parents bc577dc + c0cc003 commit 44277a4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/doc/src/reference/specifying-dependencies.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,19 @@ is ignored and should not be used in version requirements.
163163
>
164164
> Avoid constraining the upper bound of a version to be anything less than the
165165
> next semver incompatible version
166-
> (e.g. avoid `">=2.0, <2.4"`) as other packages in the dependency tree may
166+
> (e.g. avoid `">=2.0, <2.4"`, `"2.0.*"`, or `~2.0`),
167+
> as other packages in the dependency tree may
167168
> require a newer version, leading to an unresolvable error (see [#9029]).
168169
> Consider whether controlling the version in your [`Cargo.lock`] would be more
169170
> appropriate.
170171
>
171172
> In some instances this won't matter or the benefits might outweigh the cost, including:
172-
> - When no one else depends on your package e.g. it only has a `[[bin]]`
173+
> - When no one else depends on your package; e.g. it only has a `[[bin]]`
173174
> - When depending on a pre-release package and wishing to avoid breaking
174-
> changes then a fully specified `"=1.2.3-alpha.3"` might be warranted (see
175+
> changes, then a fully specified `"=1.2.3-alpha.3"` might be warranted (see
175176
> [#2222])
176177
> - When a library re-exports a proc-macro but the proc-macro generates code that
177-
> calls into the re-exporting library then a fully specified `=1.2.3` might be
178+
> calls into the re-exporting library, then a fully specified `=1.2.3` might be
178179
> warranted to ensure the proc-macro isn't newer than the re-exporting library
179180
> and generating code that uses parts of the API that don't exist within the
180181
> current version

0 commit comments

Comments
 (0)