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
Top-level overrides with [replace] as implemented in #2385 require that the replacement has the exact same version number in its Cargo.toml as the package being replaced. As others have discussed in the PR I think this restriction gets in the way more than it helps.
Here is a workflow I just had. This happens more often than not when I use [replace].
I use some package maintained by someone else. In this case xml-rs.
I realize I need some functionality to be added in that package. Maybe it just belongs there better, or like here I can’t do it in my own crates because of privacy or trait coherence rules.
Back in my crate I add a [replace] override, which doesn’t work because versions don’t match. I have to revert the version number locally. If I want some else to use my override, I need to push a second branch of the dependency with the same changes but without the version number increment.
Cargo doesn’t let me "update" my dependency (not the replacement) to a version that isn’t published yet.
Maybe the requirement could be that the replacement’s version is SemVer-compatible with the thing being replaced, instead of exactly the same?
Top-level overrides with
[replace]as implemented in #2385 require that the replacement has the exact same version number in itsCargo.tomlas the package being replaced. As others have discussed in the PR I think this restriction gets in the way more than it helps.Here is a workflow I just had. This happens more often than not when I use
[replace].[replace]override, which doesn’t work because versions don’t match. I have to revert the version number locally. If I want some else to use my override, I need to push a second branch of the dependency with the same changes but without the version number increment.Maybe the requirement could be that the replacement’s version is SemVer-compatible with the thing being replaced, instead of exactly the same?