Undo macro exports from PR #1917

All of these macros are only used internally within the serde crate.
There is no need for them to have #[macro_export] and need to be hidden
from docs.
This commit is contained in:
David Tolnay 2021-01-23 12:23:10 -08:00
parent 34f4b68f77
commit b20214d4a0
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 14 additions and 17 deletions

View File

@ -25,15 +25,13 @@ use lib::*;
use self::private::{First, Second};
use __private::de::size_hint;
use de::{self, Expected, IntoDeserializer, SeqAccess};
use de::{self, Deserializer, Expected, IntoDeserializer, SeqAccess, Visitor};
use ser;
////////////////////////////////////////////////////////////////////////////////
/// For structs that contain a PhantomData. We do not want the trait
/// bound `E: Clone` inferred by derive(Clone).
#[doc(hidden)]
#[macro_export]
// For structs that contain a PhantomData. We do not want the trait
// bound `E: Clone` inferred by derive(Clone).
macro_rules! impl_copy_clone {
($ty:ident $(<$lifetime:tt>)*) => {
impl<$($lifetime,)* E> Copy for $ty<$($lifetime,)* E> {}
@ -46,9 +44,8 @@ macro_rules! impl_copy_clone {
};
}
/// Creates a deserializer any method of which forwards to the specified visitor method
#[doc(hidden)]
#[macro_export(local_inner_macros)]
// Creates a deserializer any method of which forwards to the specified visitor
// method.
macro_rules! forward_deserializer {
// Non-borrowed references
(
@ -76,15 +73,15 @@ macro_rules! forward_deserializer {
impl_copy_clone!($deserializer $(<$lifetime>)*);
impl<'de, $($lifetime,)* E> $crate::de::Deserializer<'de> for $deserializer<$($lifetime,)* E>
impl<'de, $($lifetime,)* E> Deserializer<'de> for $deserializer<$($lifetime,)* E>
where
E: $crate::de::Error,
E: de::Error,
{
type Error = E;
fn deserialize_any<V>(self, visitor: V) -> $crate::export::Result<V::Value, Self::Error>
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: $crate::de::Visitor<'de>,
V: Visitor<'de>,
{
visitor.$visit(self.value)
}
@ -120,15 +117,15 @@ macro_rules! forward_deserializer {
impl_copy_clone!($deserializer<'de>);
impl<'de, E> $crate::de::Deserializer<'de> for $deserializer<'de, E>
impl<'de, E> Deserializer<'de> for $deserializer<'de, E>
where
E: $crate::de::Error,
E: de::Error,
{
type Error = E;
fn deserialize_any<V>(self, visitor: V) -> $crate::export::Result<V::Value, Self::Error>
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: $crate::de::Visitor<'de>,
V: Visitor<'de>,
{
visitor.$visit(self.value)
}

View File

@ -1,7 +1,7 @@
use lib::*;
use de::value::{BorrowedBytesDeserializer, BytesDeserializer};
use de::{Deserialize, DeserializeSeed, Deserializer, Error, IntoDeserializer, Visitor};
use de::{self, Deserialize, DeserializeSeed, Deserializer, Error, IntoDeserializer, Visitor};
#[cfg(any(feature = "std", feature = "alloc"))]
use de::{MapAccess, Unexpected};