Obligation checking for the Hash ability

This implements type-level checks that types can and cannot implement
the `Hash` ability.

Part of #4195
This commit is contained in:
Ayaz Hafiz 2022-10-04 10:51:14 -05:00
parent ca4ee908f8
commit e9efc95425
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
4 changed files with 244 additions and 4 deletions

View file

@ -50,6 +50,7 @@ const PRETTY_PRINT_DEBUG_SYMBOLS: bool = true;
pub const DERIVABLE_ABILITIES: &[(Symbol, &[Symbol])] = &[
(Symbol::ENCODE_ENCODING, &[Symbol::ENCODE_TO_ENCODER]),
(Symbol::DECODE_DECODING, &[Symbol::DECODE_DECODER]),
(Symbol::HASH_HASH_ABILITY, &[Symbol::HASH_HASH]),
];
/// In Debug builds only, Symbol has a name() method that lets