}
impl<D: Decoder> rustc_serialize::Decodable<D> for AttrId {
- fn decode(d: &mut D) -> AttrId {
- d.read_unit();
+ fn decode(_: &mut D) -> AttrId {
crate::attr::mk_attr_id()
}
}
impl<D: serialize::Decoder> serialize::Decodable<D> for PredecessorCache {
#[inline]
- fn decode(d: &mut D) -> Self {
- let () = d.read_unit();
+ fn decode(_: &mut D) -> Self {
Self::new()
}
}
impl<$($typaram ),*> Decoder for $DecoderName<$($typaram),*> {
$crate::__impl_decoder_methods! {
- read_unit -> ();
-
read_u128 -> u128;
read_u64 -> u64;
read_u32 -> u32;
}
impl<'a> serialize::Decoder for Decoder<'a> {
- #[inline]
- fn read_unit(&mut self) -> () {
- ()
- }
-
#[inline]
fn read_u128(&mut self) -> u128 {
read_leb128!(self, read_u128_leb128)
// concise.
pub trait Decoder {
// Primitive types:
- fn read_unit(&mut self) -> ();
fn read_usize(&mut self) -> usize;
fn read_u128(&mut self) -> u128;
fn read_u64(&mut self) -> u64;
}
impl<D: Decoder> Decodable<D> for () {
- fn decode(d: &mut D) -> () {
- d.read_unit()
- }
+ fn decode(_: &mut D) -> () {}
}
impl<S: Encoder, T> Encodable<S> for PhantomData<T> {
}
impl<D: Decoder, T> Decodable<D> for PhantomData<T> {
- fn decode(d: &mut D) -> PhantomData<T> {
- d.read_unit();
+ fn decode(_: &mut D) -> PhantomData<T> {
PhantomData
}
}