Fix stack overflow in CoreDID
PartialEq
impl
#946
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of change
Fixes an infinite recursion when comparing
CoreDID
s. The following example currently causes a stack overflow:The Rust compiler ends up effectively calling:
which recurses infinitely. The implementation is:
Two options for fixing the situation: 1) Using
*other
or 2) removing the impl. We don't use this implementation anywhere, and since this impl has been around for 9 months without anyone running into the problem, there's a good chance no one is using it. Note that this is an additional implementation next to the derivedPartialEq
impl onCoreDID
. So this PR removes this impl. However, if we don't want this to be a breaking change or think it's a convenient impl, we can also go with option 1.Edit: CI is failing due to a known ICE: rust-lang/rust#99261
Links to any relevant issues
n/a
Type of change
Add an
x
to the boxes that are relevant to your changes.How the change has been tested
Ran the above example before and after the change.
Change checklist
Add an
x
to the boxes that are relevant to your changes.