Macro to ignore tokens in doc test

This commit is contained in:
David Tolnay
2017-04-07 09:28:33 -07:00
parent 995f2b3f76
commit 467b5fc595
2 changed files with 9 additions and 2 deletions
+7
View File
@@ -329,3 +329,10 @@ macro_rules! __serialize_unimplemented {
)*
};
}
/// Used only by Serde doc tests. Not public API.
#[doc(hidden)]
#[macro_export]
macro_rules! __serde_ignore_tokens {
($($tt:tt)+) => {}
}
+2 -2
View File
@@ -35,9 +35,9 @@ use ser::{self, Serialize, SerializeSeq, SerializeTuple, SerializeTupleStruct,
/// -> Result<Self::SerializeSeq, Error> {
/// // Given Impossible cannot be instantiated, the only
/// // thing we can do here is to return an error.
/// # macro_rules! ellipses { () => {
/// # __serde_ignore_tokens! {
/// Err(...)
/// # } }
/// # }
/// # unimplemented!()
/// }
///