-
Notifications
You must be signed in to change notification settings - Fork 16
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
Switch to Scroll-owned Goldilocks repository #459
Conversation
Use a derived implementation.
Ord
implementation for Expression
For the |
I only added 'derive Ord' to the upstream repo (which is now scroll owned) recently. In general, we should do more upstream fixes, instead of just working around them. |
@yczhangsjtu Please tell me, if there's anything left you want me to do before you can approve? (Or let me know, if you just feel uncomfortable with the responsibility.) |
I do feel uneasy since the default implementation may introduce a different order on the types from here, and I don't know if that might break something. But I figure it should be okay if the tests pass. |
So the reason for this custom implementation was that |
Well, that's my best guess from reading the code and digging through the git history. There was lots of other weirdness that I can't explain, though. For example, why all the tedious cases analysis, instead of |
That's a fair point to make. Do you want me to investigate, or are you happy with the existing tests? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any other differences besides Ord?
@@ -22,7 +22,7 @@ use crate::{ | |||
structs::{ChallengeId, RAMType, WitnessId}, | |||
}; | |||
|
|||
#[derive(Clone, Debug, PartialEq, Eq)] | |||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Not really. |
That weird custom Ord is used to deduplicate commutative operations ( It can be replaced with the default order now. |
I understand that one. I was more confused by the custom reimplementation of 'then'. |
Also remove manual
Ord
implementation forExpression
and use a derived implementation that does the same as the manual one used to do.