about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_ast/src/ast.rs2
-rw-r--r--compiler/rustc_middle/src/ty/codec.rs2
-rw-r--r--compiler/rustc_serialize/src/json.rs2
-rw-r--r--compiler/rustc_serialize/src/opaque.rs2
-rw-r--r--compiler/rustc_serialize/src/serialize.rs6
5 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index 438168f4fcc..0dd10a1d066 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -2419,7 +2419,7 @@ impl<S: Encoder> rustc_serialize::Encodable<S> for AttrId {
 
 impl<D: Decoder> rustc_serialize::Decodable<D> for AttrId {
     fn decode(d: &mut D) -> Result<AttrId, D::Error> {
-        d.read_nil().map(|_| crate::attr::mk_attr_id())
+        d.read_unit().map(|_| crate::attr::mk_attr_id())
     }
 }
 
diff --git a/compiler/rustc_middle/src/ty/codec.rs b/compiler/rustc_middle/src/ty/codec.rs
index db37d98614e..eb46cdac1da 100644
--- a/compiler/rustc_middle/src/ty/codec.rs
+++ b/compiler/rustc_middle/src/ty/codec.rs
@@ -459,7 +459,7 @@ macro_rules! implement_ty_decoder {
                 type Error = String;
 
                 $crate::__impl_decoder_methods! {
-                    read_nil -> ();
+                    read_unit -> ();
 
                     read_u128 -> u128;
                     read_u64 -> u64;
diff --git a/compiler/rustc_serialize/src/json.rs b/compiler/rustc_serialize/src/json.rs
index cb9df3c3389..d3d72ba72a7 100644
--- a/compiler/rustc_serialize/src/json.rs
+++ b/compiler/rustc_serialize/src/json.rs
@@ -2240,7 +2240,7 @@ macro_rules! read_primitive {
 impl crate::Decoder for Decoder {
     type Error = DecoderError;
 
-    fn read_nil(&mut self) -> DecodeResult<()> {
+    fn read_unit(&mut self) -> DecodeResult<()> {
         expect!(self.pop(), Null)
     }
 
diff --git a/compiler/rustc_serialize/src/opaque.rs b/compiler/rustc_serialize/src/opaque.rs
index 078237801be..7e515abbe7b 100644
--- a/compiler/rustc_serialize/src/opaque.rs
+++ b/compiler/rustc_serialize/src/opaque.rs
@@ -567,7 +567,7 @@ impl<'a> serialize::Decoder for Decoder<'a> {
     type Error = String;
 
     #[inline]
-    fn read_nil(&mut self) -> Result<(), Self::Error> {
+    fn read_unit(&mut self) -> Result<(), Self::Error> {
         Ok(())
     }
 
diff --git a/compiler/rustc_serialize/src/serialize.rs b/compiler/rustc_serialize/src/serialize.rs
index 96a2231b590..e5104b14724 100644
--- a/compiler/rustc_serialize/src/serialize.rs
+++ b/compiler/rustc_serialize/src/serialize.rs
@@ -177,7 +177,7 @@ pub trait Decoder {
     type Error;
 
     // Primitive types:
-    fn read_nil(&mut self) -> Result<(), Self::Error>;
+    fn read_unit(&mut self) -> Result<(), Self::Error>;
     fn read_usize(&mut self) -> Result<usize, Self::Error>;
     fn read_u128(&mut self) -> Result<u128, Self::Error>;
     fn read_u64(&mut self) -> Result<u64, Self::Error>;
@@ -436,7 +436,7 @@ impl<S: Encoder> Encodable<S> for () {
 
 impl<D: Decoder> Decodable<D> for () {
     fn decode(d: &mut D) -> Result<(), D::Error> {
-        d.read_nil()
+        d.read_unit()
     }
 }
 
@@ -448,7 +448,7 @@ impl<S: Encoder, T> Encodable<S> for PhantomData<T> {
 
 impl<D: Decoder, T> Decodable<D> for PhantomData<T> {
     fn decode(d: &mut D) -> Result<PhantomData<T>, D::Error> {
-        d.read_nil()?;
+        d.read_unit()?;
         Ok(PhantomData)
     }
 }