Optional dependencies and MSRV

In rsass I have an optional dependency for clap which I just updated to 4.0. Earlier, I used to test with an old rust version that was not supported by clap, and that went well as long as I didn't enable the feature using clap. Now, this happens instead:

: kalarba%; cargo +1.56.1 test
    Updating crates.io index
error: failed to select a version for the requirement `clap = "=4.0.8"`
candidate versions found which didn't match: 3.2.22, 3.2.21, 3.2.20, ...
location searched: crates.io index
required by package `rsass v0.26.1-PRE (/home/kaj/proj/rust/rsass)`

The difference seems to be that clap has properly declare a rust_version = 1.60 in their Cargo.toml.

Is it possible to get this to work? Can I declare a rust_version for the feature which is higher than the rust_version for my crate?

It's more than that. Crates that use a new features syntax from Rust 1.60 have a new incompatible format in the crates-io index, and are "invisible" to old Rust versions.

You can specify version requirement as clap = "3 || 4" and the older Rust versions will find v3.

1 Like

Huh? Does that imply that testing my crate with rust 1.58.1 is pointless anyway, as anyone who uses that won't be able to see my new releases?

If 1.58 can parse your Cargo.toml then it's probably fine. It'd protest about the yet-unsupported feature syntax otherwise.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.