]> git.lizzy.rs Git - rust.git/commitdiff
Delete Decoder::read_unit
authorMark Rousskov <mark.simulacrum@gmail.com>
Tue, 22 Feb 2022 23:14:51 +0000 (18:14 -0500)
committerMark Rousskov <mark.simulacrum@gmail.com>
Tue, 22 Feb 2022 23:14:51 +0000 (18:14 -0500)
compiler/rustc_ast/src/ast.rs
compiler/rustc_middle/src/mir/predecessors.rs
compiler/rustc_middle/src/ty/codec.rs
compiler/rustc_serialize/src/opaque.rs
compiler/rustc_serialize/src/serialize.rs

index e9135b7163025aff04b91749d10314e4be7e2031..0449d715a5e1aec8d9bd0c5a44e86c0586f1290f 100644 (file)
@@ -2418,8 +2418,7 @@ fn encode(&self, s: &mut S) -> Result<(), S::Error> {
 }
 
 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()
     }
 }
index 2562baac91131881e6a7aaf76e4b9ac0ccf86b23..4fe2cde753290226889e54fc4591db806410d0f7 100644 (file)
@@ -63,8 +63,7 @@ fn encode(&self, s: &mut S) -> Result<(), S::Error> {
 
 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()
     }
 }
index 7a6cbea00d866ce7cf8d923e2384a3ee8e7e24b2..23fb7a49d9c8e923602a56e5f66a1e504aaf8b92 100644 (file)
@@ -465,8 +465,6 @@ mod __ty_decoder_impl {
 
             impl<$($typaram ),*> Decoder for $DecoderName<$($typaram),*> {
                 $crate::__impl_decoder_methods! {
-                    read_unit -> ();
-
                     read_u128 -> u128;
                     read_u64 -> u64;
                     read_u32 -> u32;
index 1a71ee9038bcbee688930cb791539797e69cae3a..5e5cbacbcff1a47c9551f9c6c76b99116f96b8c7 100644 (file)
@@ -555,11 +555,6 @@ macro_rules! read_leb128 {
 }
 
 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)
index 7b6dd8b60f800fbfa1af7a32bcff5b20c9224629..42bf6ff2a9852101431f4464874d3bc5443121b7 100644 (file)
@@ -181,7 +181,6 @@ fn emit_map_elt_val<F>(&mut self, f: F) -> Result<(), Self::Error>
 // 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;
@@ -324,9 +323,7 @@ fn encode(&self, s: &mut S) -> Result<(), S::Error> {
 }
 
 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> {
@@ -336,8 +333,7 @@ fn encode(&self, s: &mut S) -> Result<(), S::Error> {
 }
 
 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
     }
 }