-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deranged 0.4.1 breaks build of other crates (PartialEq
with empty slices)
#21
Comments
This breaks our code base for downstream users who do not use
|
This avoids jhpratt/deranged#21, which broke these commands: x test tests/ui-fulldeps/stable-mir/check_abi.rs x dist clippy x test rust-analyzer
Please release |
Unfortunately there isn't really anything that can be done on my end. The impl is considered acceptable breakage per RFC 1105, and even if it happened in a breaking release the same issue would arise due to it being an indirect (and not publicly exposed) dependency. |
This fixed compile error described in [1] Also use expect instead of unwrap. [1] jhpratt/deranged#21
Something seems off if a crate introduces breakage to entirely unrelated code that isn't even close to any of the types involved in the crate -- maybe this is formally acceptable, but it's not something I encountered before with another crate, and it is not nice to have invasive changes on unrelated code paths in this way. |
I tend to disagree - there are other solutions than adding a trait that leaks on other crates. Implementing
This RFC covers semver and version numbering. I do not think breaking a default trait implementation for all other crates can be described as an "API change" I understand the changes you pushed might be nice, but I kindly ask you to reconsider the "wontfix". Maybe this trait can be used only internally (or when imported), or maybe using |
imo this is on Rust — type inference errors are far too easy to cause. impl<T, U> PartialEq<[U]> for [T]
where
T: PartialEq<U> If this were
That's simply not possible. The orphan rule prevents doing this in a downstream crate, which is precisely what the impl is intended for. Not directed at anyone in particular, but I will restate this. Yanking and releasing as 0.5 accomplishes nothing, unless you are relying on |
Fair enough that a version bump doesn't help as the conflicting code is in downstreams. It does mean this is no longer possible in any crate that has deranged somewhere in the dependency graph:
Causes:
Should this be reported on rust issue tracker or is this working as intended? |
While I still believe this can and should be handled better by the language, the reality is that it isn't and caused breakage in more ways than I thought would happen, including code that cannot easily be adjusted. For that reason, I am reconsidering whether to yank the release. If I do, there will not be a 0.5 release with the same. It would be removed entirely unless and until it is handled better on the language side (which I advocate for regardless). Expect a final decision in the next day or two at the latest. I will announce it here regardless of outcome. The reason for the delay is that I'm currently busy and abroad, which is not a good combination for making OSS decisions. |
Alright, it's yanked. Hopefully this improves things! |
Thanks!
I fully agree that this is an issue with the trait system. But that system is hard to improve an meanwhile we have to live with the system that we have.
|
The issues were in: deranged 0.4.1: - yanked - (Issue was a compatibility-break, not security: jhpratt/deranged#21) tokio 1.44.1: - RUSTSEC-2025-0023 - (I believe we're okay, since we don't use tokio's broadcast channel) openssl 0.10.71 - RUSTSEC-2025-0022 - (We do not appear to use the affected APIs.)
Hi,
After a
cargo update
from 0.4.0 to 0.4.1, building unit tests breaks in unrelated parts of my crate (asn1-rs
) due to a conflicting implementation ofPartialEq
. Building with 0.4.0 works fineI know this has already been reported, however I think this is not a duplicate:
cargo update
(includingtime
andderanged
), problem is still herecargo outdated
shows to crate to upgradetime
norderanged
I tried to pin the problem to a minimal test case
The errors are related to comparisons of empty
&[u8]
(non-empty comparison work). For ex, the following fails:Edit: the minimal crate I created to show the problem fails for another reason
Edit 2:
I have tried to isolate the problem in a minimal crate here
Adding
use time::OffsetDateTime
is enough to trigger the problem:The first function build_ok builds, while the second fails with error:
The text was updated successfully, but these errors were encountered: