mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 02:43:45 +00:00
serialize: remove proxy impls for Gc<T>.
This commit is contained in:
parent
d07cd175da
commit
8b1d3e6c1c
@ -16,7 +16,6 @@ Core encoding and decoding interfaces.
|
||||
|
||||
use std::path;
|
||||
use std::rc::Rc;
|
||||
use std::gc::{Gc, GC};
|
||||
use std::cell::{Cell, RefCell};
|
||||
|
||||
pub trait Encoder<E> {
|
||||
@ -392,12 +391,6 @@ impl<E, D:Decoder<E>,T:Decodable<D, E>> Decodable<D, E> for Box<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<E, S:Encoder<E>,T:'static + Encodable<S, E>> Encodable<S, E> for Gc<T> {
|
||||
fn encode(&self, s: &mut S) -> Result<(), E> {
|
||||
(**self).encode(s)
|
||||
}
|
||||
}
|
||||
|
||||
impl<E, S:Encoder<E>,T:Encodable<S, E>> Encodable<S, E> for Rc<T> {
|
||||
#[inline]
|
||||
fn encode(&self, s: &mut S) -> Result<(), E> {
|
||||
@ -412,12 +405,6 @@ impl<E, D:Decoder<E>,T:Decodable<D, E>> Decodable<D, E> for Rc<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<E, D:Decoder<E>,T:Decodable<D, E> + 'static> Decodable<D, E> for Gc<T> {
|
||||
fn decode(d: &mut D) -> Result<Gc<T>, E> {
|
||||
Ok(box(GC) try!(Decodable::decode(d)))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, E, S:Encoder<E>,T:Encodable<S, E>> Encodable<S, E> for &'a [T] {
|
||||
fn encode(&self, s: &mut S) -> Result<(), E> {
|
||||
s.emit_seq(self.len(), |s| {
|
||||
|
Loading…
Reference in New Issue
Block a user