Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

^ versions handled incorrectly #39

Closed
rbtcollins opened this issue Feb 20, 2019 · 2 comments
Closed

^ versions handled incorrectly #39

rbtcollins opened this issue Feb 20, 2019 · 2 comments

Comments

@rbtcollins
Copy link

A version in Cargo.toml like ^2 will match versions >=2 and <3. So it should show with a 👍 when the current version in crates.io is 2.5, but instead I get this:

pest = "^2.0"  Latest:2.1.0
pest_derive = "^2.0" Latest:2.1.0

However, cargo build is actually using 2.1.0.

@serayuzgur
Copy link
Owner

serayuzgur commented Feb 20, 2019

Hi @rbtcollins
When I check crates.io it shows 2.1.0 . Please check from crates.io link

Please do not forget this plugin only fetches versions from crates.io

Please use pest = "2" to see thumbs up

@rbtcollins
Copy link
Author

I think you've misunderstood the bug report. I agree that 2.1.0 is what crates.io shows. The defect is that the matching algorithm for determining whether the dependency version is up to date in Cargo.toml is incorrect.

^ means 'match major version`. (Actually its more subtle than that, but this report isn't about versions less than 1.

Here is the current behaviours with pest:

Cargo.toml vscode-crates output Cargo uses version
"2.0" Latest:2.1.0 2.1.0
"^2.0" Latest:2.1.0 2.1.0
"2" 👍 2.1.0
"2.1" 👍 2.1.0
"~2.0" Latest:2.1.0 2.0.2

This doesn't make sense to me: Only the last one is building with a non-latest version, but two of them show the "Latest" warning to encourage updating, even though thats not needed. From a cargo-semver perspective the first three entries are all identical: they all specify anything >= 2 but less than 3. Why is crates showing these warnings?

@serayuzgur serayuzgur reopened this Feb 21, 2019
RensAlthuis added a commit to RensAlthuis/crates that referenced this issue Sep 20, 2019
@RensAlthuis RensAlthuis mentioned this issue Oct 2, 2019
RensAlthuis added a commit to RensAlthuis/crates that referenced this issue Oct 3, 2019
This reverts commit 6e27acc.
RensAlthuis added a commit to RensAlthuis/crates that referenced this issue Oct 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants