Implement obligation checking for the Eq ability

Every type can have `Eq.isEq` derived for it, as long as

- it does not transitively contain a function
- it does not transitively contain a floating point value
- it does not transitively contain an opaque type that does not support
  `Eq`
This commit is contained in:
Ayaz Hafiz 2022-10-05 15:07:27 -05:00
parent 5931dd5fc2
commit b587bcf0c2
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
5 changed files with 437 additions and 81 deletions

View file

@ -67,9 +67,15 @@ pub enum NotDerivableContext {
UnboundVar,
Opaque(Symbol),
Decode(NotDerivableDecode),
Eq(NotDerivableEq),
}
#[derive(PartialEq, Debug, Clone)]
pub enum NotDerivableDecode {
OptionalRecordField(Lowercase),
}
#[derive(PartialEq, Debug, Clone)]
pub enum NotDerivableEq {
FloatingPoint,
}