crates icon indicating copy to clipboard operation
crates copied to clipboard

Aliased crates in object format [dependencies.example] always report an error

Open chanced opened this issue 2 years ago • 1 comments

Describe the bug When using an object notation [dependencies.example] with an aliased crate name, an error is displayed indicating that the version is not correct. If the condensed format is used, this works perfectly fine.

For example, this reports as having an invalid version:

[dependencies.rust-crypto-p256]
package = "p256"
version = "0.12"

while this works fine:

[dependencies]

rust-crypto-p256 = { package = "p256", version = "0.12" }

To Reproduce Steps to reproduce the behavior:

  1. cargo init example
  2. cd example
  3. edit Cargo.toml
  4. add:
[dependecies.example]
package = "serde"
version = "1.0"

Expected behavior The format of the dependencies list should not matter when dealing with aliased dependencies.

Screenshots works

doesnt work

Desktop (please complete the following information):

  • OS: macOS
  • Version Ventura 13.0.1

chanced avatar Feb 03 '23 19:02 chanced

To expand on this, one issue seems to be that the value of package is not being considered.

crates warns that this should be 0.13.2, which is the most recently published version of the random crate, not rand:

[dependencies.random]
package = "rand"
version = "0.8"
Screenshot 2023-02-03 at 5 05 55 PM

chanced avatar Feb 03 '23 22:02 chanced