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

Remove Eq trait bound #31

Merged
merged 1 commit into from
Dec 30, 2024
Merged

Conversation

tcharding
Copy link
Member

The PartialOrd trait is object safe but Ord is not. We can make ArbitraryOrd object safe by softening the bounds and only requiring PartialEq - we still provide a blanket implementation of Ord if Eq is implemented for T.

Add a unit test that verifies using Box<dyn T> - props to Poelstra for the idea.

The `PartialOrd` trait is object safe but `Ord` is not. We can make
`ArbitraryOrd` object safe by softening the bounds and only requiring
`PartialEq` - we still provide a blanket implementation of `Ord` if `Eq`
is implemented for `T`.

Add a unit test that verifies using `Box<dyn T>` - props to Poelstra for
the idea.
@tcharding tcharding changed the title Remove Eq trait bound Remove Eq trait bound Dec 29, 2024
@tcharding
Copy link
Member Author

Requires another release if this merges.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 3280db4; successfully ran local tests; nice! Yeah, we never would have gotten this right by hand

@apoelstra apoelstra merged commit dd3ecef into rust-bitcoin:master Dec 30, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants