From 4711982314ba33cab83704c26484b501c8652774 Mon Sep 17 00:00:00 2001 From: kennytm Date: Tue, 20 Jun 2017 15:15:16 +0800 Subject: Removed as many "```ignore" as possible. Replaced by adding extra imports, adding hidden code (`# ...`), modifying examples to be runnable (sorry Homura), specifying non-Rust code, and converting to should_panic, no_run, or compile_fail. Remaining "```ignore"s received an explanation why they are being ignored. --- src/libsyntax_ext/deriving/encodable.rs | 12 ++++++++---- src/libsyntax_ext/deriving/generic/mod.rs | 12 +++++++----- src/libsyntax_ext/format.rs | 3 ++- 3 files changed, 17 insertions(+), 10 deletions(-) (limited to 'src/libsyntax_ext') diff --git a/src/libsyntax_ext/deriving/encodable.rs b/src/libsyntax_ext/deriving/encodable.rs index 9d155c22ad0..33f742282c1 100644 --- a/src/libsyntax_ext/deriving/encodable.rs +++ b/src/libsyntax_ext/deriving/encodable.rs @@ -14,14 +14,15 @@ //! //! For example, a type like: //! -//! ```ignore +//! ``` //! #[derive(Encodable, Decodable)] //! struct Node { id: usize } //! ``` //! //! would generate two implementations like: //! -//! ```ignore +//! ``` +//! # struct Node { id: usize } //! impl, E> Encodable for Node { //! fn encode(&self, s: &mut S) -> Result<(), E> { //! s.emit_struct("Node", 1, |this| { @@ -48,14 +49,17 @@ //! Other interesting scenarios are when the item has type parameters or //! references other non-built-in types. A type definition like: //! -//! ```ignore +//! ``` +//! # #[derive(Encodable, Decodable)] struct Span; //! #[derive(Encodable, Decodable)] //! struct Spanned { node: T, span: Span } //! ``` //! //! would yield functions like: //! -//! ```ignore +//! ``` +//! # #[derive(Encodable, Decodable)] struct Span; +//! # struct Spanned { node: T, span: Span } //! impl< //! S: Encoder, //! E, diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index be7883cad5f..3a15b82d19f 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -456,7 +456,7 @@ impl<'a> TraitDef<'a> { /// Given that we are deriving a trait `DerivedTrait` for a type like: /// - /// ```ignore + /// ```ignore (only-for-syntax-highlight) /// struct Struct<'a, ..., 'z, A, B: DeclaredTrait, C, ..., Z> where C: WhereTrait { /// a: A, /// b: B::Item, @@ -469,7 +469,7 @@ impl<'a> TraitDef<'a> { /// /// create an impl like: /// - /// ```ignore + /// ```ignore (only-for-syntax-highlight) /// impl<'a, ..., 'z, A, B: DeclaredTrait, C, ... Z> where /// C: WhereTrait, /// A: DerivedTrait + B1 + ... + BN, @@ -933,8 +933,9 @@ impl<'a> MethodDef<'a> { } } - /// ```ignore + /// ``` /// #[derive(PartialEq)] + /// # struct Dummy; /// struct A { x: i32, y: i32 } /// /// // equivalent to: @@ -1040,8 +1041,9 @@ impl<'a> MethodDef<'a> { &StaticStruct(struct_def, summary)) } - /// ```ignore + /// ``` /// #[derive(PartialEq)] + /// # struct Dummy; /// enum A { /// A1, /// A2(i32) @@ -1624,7 +1626,7 @@ pub fn cs_fold(use_foldl: bool, /// Call the method that is being derived on all the fields, and then /// process the collected results. i.e. /// -/// ```ignore +/// ```ignore (only-for-syntax-highlight) /// f(cx, span, vec![self_1.method(__arg_1_1, __arg_2_1), /// self_2.method(__arg_1_2, __arg_2_2)]) /// ``` diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index 24c1dfe289b..a6768c07fe1 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -117,7 +117,8 @@ struct Context<'a, 'b: 'a> { /// expressions. /// /// If parsing succeeds, the return value is: -/// ```ignore +/// +/// ```text /// Some((fmtstr, parsed arguments, index map for named arguments)) /// ``` fn parse_args(ecx: &mut ExtCtxt, -- cgit 1.4.1-3-g733a5