Add HashStable_NoContext to simplify HashStable implementations in rustc_type_ir

This commit is contained in:
Michael Goulet
2023-11-04 17:02:54 +00:00
parent baf4abff31
commit 426bc70ad6
10 changed files with 69 additions and 291 deletions

View File

@@ -48,6 +48,13 @@ decl_derive!(
[HashStable_Generic, attributes(stable_hasher)] =>
hash_stable::hash_stable_generic_derive
);
decl_derive!(
[HashStable_NoContext] =>
/// `HashStable` implementation that has no `HashStableContext` bound and
/// which adds `where` bounds for `HashStable` based off of fields and not
/// generics. This is suitable for use in crates like `rustc_type_ir`.
hash_stable::hash_stable_no_context_derive
);
decl_derive!([Decodable] => serialize::decodable_derive);
decl_derive!([Encodable] => serialize::encodable_derive);