Skip to content
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

skiplist: extract equivalent mod to a crate #1158

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

al8n
Copy link
Contributor

@al8n al8n commented Dec 11, 2024

Hi, this PR extracts equivalent mod in crossbeam-skiplist to equivalent-flipped crate so that users can implement Comparable and Equivalent without depending on crossbeam-skiplist.

@al8n
Copy link
Contributor Author

al8n commented Dec 18, 2024

indexmap directly uses equivalent: v1 to avoid break-changing or compatible issues.
I published equivalent-flipped version 1.0.0, and I think there should not be more changes in equivalent-flipped, so it should be ok for crossbeam-skiplist to use equivalent-flipped: v1.

@al8n
Copy link
Contributor Author

al8n commented Jan 19, 2025

Hi @taiki-e, any suggestions on this PR?

@thynson
Copy link
Contributor

thynson commented Jan 20, 2025

This looks reasonable from my eye.

Edit: Nevermind, I didn't see the re-exports, though it is almost a compatible change, it may still suprise the user that type unintentionally implemented a different trait.

However, since the desired next release version is 0.1.4, breaking change is should be avoided, so I would like to suggest to implemented it in this way:

#[cfg(feature="equivalent_flipped")]
impl <T> Equivalent for T where T: equivalent_flipped::Equivalent { /* ** */ }

#[cfg(feature="equivalent_flipped")]
impl <T> Comparable for T where T: equivalent_flipped::Comparable { /* ** */ }

@thynson
Copy link
Contributor

thynson commented Jan 20, 2025

After carefully considering, I believe it will be a breaking change anyway.

Either re-exports or blanket impls break the following code, rustc consider the following trait impls conflicted.

struct SomeType;

impl equivalent_flipped::Equivalent for SomeType { /* ** */ }

impl crossbeam_skiplist::Equivalent for SomeType { /* ** */ }

@al8n
Copy link
Contributor Author

al8n commented Jan 20, 2025

After carefully considering, I believe it will be a breaking change anyway.

Either re-exports or blanket impls break the following code, rustc consider the following trait impls conflicted.

struct SomeType;



impl equivalent_flipped::Equivalent for SomeType { /* ** */ }



impl crossbeam_skiplist::Equivalent for SomeType { /* ** */ }

I do not think this is a breaking change, because the current 0.1.3 still using Borrow, the Equivalent and Comparable version has not been released, so this will not influence the crates which are using 0.1.3

@thynson
Copy link
Contributor

thynson commented Jan 20, 2025

Equivalent and Comparable version has not been released, so this will not influence the crates which are using 0.1.3...

Okay, so is there any concern blocking the release of v0.1.4? @taiki-e

@taiki-e
Copy link
Member

taiki-e commented Jan 20, 2025

The re-export compatibility issue mentioned in #1132 is why this is a blocker that should be resolved before release.
And the blocker against merging this is the supply chain issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants