diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-03-28 19:53:01 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-05-13 08:06:48 +0200 |
| commit | 9900ea352b1b7dbcbe290bbb62f436c91818c5d1 (patch) | |
| tree | a3dc7fe7489312081ebdbfd7b7dbf6e24b34e780 /compiler/rustc_serialize/src | |
| parent | 3a08bd7873ac755f93286f087fdc398380c69e21 (diff) | |
| download | rust-9900ea352b1b7dbcbe290bbb62f436c91818c5d1.tar.gz rust-9900ea352b1b7dbcbe290bbb62f436c91818c5d1.zip | |
Cache more queries on disk.
Diffstat (limited to 'compiler/rustc_serialize/src')
| -rw-r--r-- | compiler/rustc_serialize/src/collection_impls.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_serialize/src/serialize.rs | 15 |
2 files changed, 9 insertions, 16 deletions
diff --git a/compiler/rustc_serialize/src/collection_impls.rs b/compiler/rustc_serialize/src/collection_impls.rs index dee6dc010fe..761e988360a 100644 --- a/compiler/rustc_serialize/src/collection_impls.rs +++ b/compiler/rustc_serialize/src/collection_impls.rs @@ -171,16 +171,6 @@ where } } -impl<E: Encoder, T, S> Encodable<E> for &HashSet<T, S> -where - T: Encodable<E> + Eq, - S: BuildHasher, -{ - fn encode(&self, s: &mut E) -> Result<(), E::Error> { - (**self).encode(s) - } -} - impl<D: Decoder, T, S> Decodable<D> for HashSet<T, S> where T: Decodable<D> + Hash + Eq, diff --git a/compiler/rustc_serialize/src/serialize.rs b/compiler/rustc_serialize/src/serialize.rs index 7d6b8c760ff..36e575b2427 100644 --- a/compiler/rustc_serialize/src/serialize.rs +++ b/compiler/rustc_serialize/src/serialize.rs @@ -268,6 +268,15 @@ direct_serialize_impls! { char emit_char read_char } +impl<S: Encoder, T: ?Sized> Encodable<S> for &T +where + T: Encodable<S>, +{ + fn encode(&self, s: &mut S) -> Result<(), S::Error> { + (**self).encode(s) + } +} + impl<S: Encoder> Encodable<S> for ! { fn encode(&self, _s: &mut S) -> Result<(), S::Error> { unreachable!() @@ -298,12 +307,6 @@ impl<S: Encoder> Encodable<S> for str { } } -impl<S: Encoder> Encodable<S> for &str { - fn encode(&self, s: &mut S) -> Result<(), S::Error> { - s.emit_str(self) - } -} - impl<S: Encoder> Encodable<S> for String { fn encode(&self, s: &mut S) -> Result<(), S::Error> { s.emit_str(&self[..]) |
