RFC: Minimum Supported Rust Version by newpavlov · Pull Request #2495 · rust-lang/rfcs (original) (raw)
Hm, I don't quite get stable(x)
functionality then. The only difference which I can see is that stable(1.30)
will hint that rust
field was automatically inserted by cargo
, otherwise behavior looks similar to me. I'll try to describe current proposal a bit better in a separate PR to my repo. I'll link it later and I will be happy to hear your comments on which parts you think will need additional clarification.
how the crate author answers the question "Is an MSRV change a breaking change?"
As I see it, if public API does not change, then MSRV change will never (well, except the initial migration to using rust
field) be a breaking change, be it upgrade or downgrade. Dependency versions resolution algorithm will handle a selection of appropriate versions for current toolchain automatically.
What if crate A depends on crate B and crate C. What are the requirements for the MSRV of crate A given the MSRV of B and C?
Don't forget that dependency can be defined as 0.x
, so you have not one version, but a set. Thus formula will be MSRV(A) >= max(min( [MSRV(A1), ..MSRV(An)] ), min( [MSRV(B1), ..MSRV(Bn)] ))
. For stable versions order should be quite simple and you even don't have to calculate it explicitly. Running cargo publish
with your MSRV toolchain will automatically check if non-empty solution for dependency versions exists.
But with "nightly versions" extension things become more complex. You'll have to check that your MSRV condition contains only such nightly versions which can be covered by all of your dependencies.
(How) is it possible to calculate with MSRVs?
I am not sure this feature will pulls its weight. Plus it can be added later in a backwards compatible way by a separate proposal.