1
Fork 0

Avoid specialization for the Span Encodable and Decodable impls

This commit is contained in:
bjorn3 2023-12-31 19:35:32 +00:00
parent 1c20462338
commit 6ed37bdc42
16 changed files with 140 additions and 94 deletions

View file

@ -16,7 +16,7 @@ pub use index_map::SortedIndexMultiMap;
/// stores data in a more compact way. It also supports accessing contiguous
/// ranges of elements as a slice, and slices of already sorted elements can be
/// inserted efficiently.
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Encodable, Decodable)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Encodable_Generic, Decodable_Generic)]
pub struct SortedMap<K, V> {
data: Vec<(K, V)>,
}

View file

@ -10,7 +10,7 @@ use std::fmt;
use crate::stable_hasher;
#[derive(Copy, Clone, PartialEq, Eq, Debug, Encodable, Decodable, Hash)]
#[derive(Copy, Clone, PartialEq, Eq, Debug, Encodable_Generic, Decodable_Generic, Hash)]
pub struct Svh {
hash: Fingerprint,
}

View file

@ -185,7 +185,7 @@ trait UnordCollection {}
///
/// See [MCP 533](https://github.com/rust-lang/compiler-team/issues/533)
/// for more information.
#[derive(Debug, Eq, PartialEq, Clone, Encodable, Decodable)]
#[derive(Debug, Eq, PartialEq, Clone, Encodable_Generic, Decodable_Generic)]
pub struct UnordSet<V: Eq + Hash> {
inner: FxHashSet<V>,
}
@ -362,7 +362,7 @@ impl<HCX, V: Hash + Eq + HashStable<HCX>> HashStable<HCX> for UnordSet<V> {
///
/// See [MCP 533](https://github.com/rust-lang/compiler-team/issues/533)
/// for more information.
#[derive(Debug, Eq, PartialEq, Clone, Encodable, Decodable)]
#[derive(Debug, Eq, PartialEq, Clone, Encodable_Generic, Decodable_Generic)]
pub struct UnordMap<K: Eq + Hash, V> {
inner: FxHashMap<K, V>,
}
@ -558,7 +558,7 @@ impl<HCX, K: Hash + Eq + HashStable<HCX>, V: HashStable<HCX>> HashStable<HCX> fo
///
/// See [MCP 533](https://github.com/rust-lang/compiler-team/issues/533)
/// for more information.
#[derive(Default, Debug, Eq, PartialEq, Clone, Encodable, Decodable)]
#[derive(Default, Debug, Eq, PartialEq, Clone, Encodable_Generic, Decodable_Generic)]
pub struct UnordBag<V> {
inner: Vec<V>,
}