Remove unneeded main functions in doc tests

These used to be needed because `#[macro_use] extern crate serde`
couldn't go inside of rustdoc's implicit main function.
This commit is contained in:
David Tolnay 2018-12-31 23:11:57 -05:00
parent 054ab1adaf
commit 0b667c88fa
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
6 changed files with 0 additions and 48 deletions

View File

@ -2225,8 +2225,6 @@ pub trait VariantAccess<'de>: Sized {
/// Self::deserialize(s.into_deserializer())
/// }
/// }
/// #
/// # fn main() {}
/// ```
pub trait IntoDeserializer<'de, E: Error = value::Error> {
/// The type of the deserializer being converted into.

View File

@ -19,8 +19,6 @@
//! Self::deserialize(s.into_deserializer())
//! }
//! }
//! #
//! # fn main() {}
//! ```
use lib::*;

View File

@ -45,8 +45,6 @@
/// # tuple tuple_struct tuple_variant map struct struct_variant
/// # }
/// }
/// #
/// # fn main() {}
/// ```
///
/// When Serde is built with support for 128-bit integers, this macro expands

View File

@ -41,8 +41,6 @@
/// # tuple_struct map struct enum identifier ignored_any
/// # }
/// # }
/// #
/// # fn main() {}
/// ```
///
/// The `forward_to_deserialize_any!` macro implements these simple forwarding
@ -73,8 +71,6 @@
/// tuple_struct map struct enum identifier ignored_any
/// }
/// }
/// #
/// # fn main() {}
/// ```
///
/// The macro assumes the convention that your `Deserializer` lifetime parameter
@ -107,8 +103,6 @@
/// tuple_struct map struct enum identifier ignored_any
/// }
/// # }
/// #
/// # fn main() {}
/// ```
///
/// [`Deserializer`]: trait.Deserializer.html

View File

@ -47,8 +47,6 @@ use ser::{
/// # tuple tuple_struct tuple_variant map struct struct_variant
/// # }
/// }
/// #
/// # fn main() {}
/// ```
///
/// [`Serializer`]: trait.Serializer.html

View File

@ -390,8 +390,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_bool(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_bool(self, v: bool) -> Result<Self::Ok, Self::Error>;
@ -414,8 +412,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_i8(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_i8(self, v: i8) -> Result<Self::Ok, Self::Error>;
@ -438,8 +434,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_i16(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_i16(self, v: i16) -> Result<Self::Ok, Self::Error>;
@ -462,8 +456,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_i32(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_i32(self, v: i32) -> Result<Self::Ok, Self::Error>;
@ -482,8 +474,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_i64(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_i64(self, v: i64) -> Result<Self::Ok, Self::Error>;
@ -503,8 +493,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_i128(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
///
/// This method is available only on Rust compiler versions >=1.26. The
@ -534,8 +522,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_u8(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_u8(self, v: u8) -> Result<Self::Ok, Self::Error>;
@ -558,8 +544,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_u16(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_u16(self, v: u16) -> Result<Self::Ok, Self::Error>;
@ -582,8 +566,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_u32(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_u32(self, v: u32) -> Result<Self::Ok, Self::Error>;
@ -602,8 +584,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_u64(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_u64(self, v: u64) -> Result<Self::Ok, Self::Error>;
@ -623,8 +603,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_u128(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
///
/// This method is available only on Rust compiler versions >=1.26. The
@ -654,8 +632,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_f32(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_f32(self, v: f32) -> Result<Self::Ok, Self::Error>;
@ -674,8 +650,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_f64(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_f64(self, v: f64) -> Result<Self::Ok, Self::Error>;
@ -697,8 +671,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_char(*self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_char(self, v: char) -> Result<Self::Ok, Self::Error>;
@ -717,8 +689,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_str(self)
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_str(self, v: &str) -> Result<Self::Ok, Self::Error>;
@ -754,8 +724,6 @@ pub trait Serializer: Sized {
/// # seq tuple tuple_struct tuple_variant map struct struct_variant
/// # }
/// # }
/// #
/// # fn main() {}
/// ```
fn serialize_bytes(self, v: &[u8]) -> Result<Self::Ok, Self::Error>;
@ -842,8 +810,6 @@ pub trait Serializer: Sized {
/// serializer.serialize_unit()
/// }
/// }
/// #
/// # fn main() {}
/// ```
fn serialize_unit(self) -> Result<Self::Ok, Self::Error>;