You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -81,6 +81,21 @@ Consider this table where `a.b.c` is compatible with `x.y.z` and `x.y.z > a.b.c`
81
81
This RFC preserves this behaviour to remain backwards compatible.
82
82
Since this RFC is concerned with the behaviour of `cargo update --precise` changes to bare `cargo update` made in future RFCs should have no impact on this proposal.
83
83
84
+
To determine if a version can be selected with `--precise` for a specification that isn't listed above cosider where pre-releases exist within version ranges.
85
+
86
+
For example consider the version `~1.2.3`.
87
+
The range for `~1.2.3` is [stated in the cargo book](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#tilde-requirements).
88
+
89
+
```
90
+
~1.2.3 := >=1.2.3, <1.3.0
91
+
```
92
+
93
+
Intuitively `1.2.4-pre.0` satisfies this inequality, therefore it can be selected with `cargo update --precise`.
94
+
Since it is a pre-release and the specification is not, `1.2.4-pre.0` would not be selected by a bare `cargo update`.
95
+
`1.3.0-pre.0` also satisfies the inequality but `1.2.3-pre.0` and `1.3.1-pre.0` do not.
96
+
97
+
Put in simple terms the relationship between a pre-release and its stable release is always `a.b.c-pre.0 < a.b.c`.
0 commit comments