diff options
| author | bors <bors@rust-lang.org> | 2014-02-15 16:36:27 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-02-15 16:36:27 -0800 |
| commit | 0c62d9d83d150c6937905288d69bf874c9fe81c3 (patch) | |
| tree | f90683b243dc6650822fb75a19e8fce8008e343e /src/libsyntax | |
| parent | d98668a55996d656072a4cac7abb1dcbbdf4f48b (diff) | |
| parent | e72ddbdc25a2696a41053832fad7d9b0428819af (diff) | |
| download | rust-0c62d9d83d150c6937905288d69bf874c9fe81c3.tar.gz rust-0c62d9d83d150c6937905288d69bf874c9fe81c3.zip | |
auto merge of #12298 : alexcrichton/rust/rustdoc-testing, r=sfackler
It's too easy to forget the `rust` tag to test something. Closes #11698
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/deriving/encodable.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/generic.rs | 26 |
2 files changed, 20 insertions, 12 deletions
diff --git a/src/libsyntax/ext/deriving/encodable.rs b/src/libsyntax/ext/deriving/encodable.rs index 468cb1544a2..9e0439e5375 100644 --- a/src/libsyntax/ext/deriving/encodable.rs +++ b/src/libsyntax/ext/deriving/encodable.rs @@ -17,8 +17,10 @@ Decodable)]. For example, a type like: +```ignore #[deriving(Encodable, Decodable)] struct Node {id: uint} +``` would generate two implementations like: @@ -43,11 +45,14 @@ impl<D:Decoder> Decodable for node_id { Other interesting scenarios are whe the item has type parameters or references other non-built-in types. A type definition like: +```ignore #[deriving(Encodable, Decodable)] struct spanned<T> {node: T, span: Span} +``` would yield functions like: +```ignore impl< S: Encoder, T: Encodable<S> @@ -73,6 +78,7 @@ would yield functions like: }) } } +``` */ use ast::{MetaItem, Item, Expr, MutMutable}; diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs index 3db07b05e52..029e87afbe2 100644 --- a/src/libsyntax/ext/deriving/generic.rs +++ b/src/libsyntax/ext/deriving/generic.rs @@ -59,7 +59,7 @@ associated with. It is only not `None` when the associated field has an identifier in the source code. For example, the `x`s in the following snippet -~~~ +~~~ignore struct A { x : int } struct B(int); @@ -83,7 +83,7 @@ variants, it is represented as a count of 0. The following simplified `Eq` is used for in-code examples: -~~~ +~~~ignore trait Eq { fn eq(&self, other: &Self); } @@ -101,7 +101,7 @@ above `Eq`, `A`, `B` and `C`. When generating the `expr` for the `A` impl, the `SubstructureFields` is -~~~ +~~~ignore Struct(~[FieldInfo { span: <span of x> name: Some(<ident of x>), @@ -112,7 +112,7 @@ Struct(~[FieldInfo { For the `B` impl, called with `B(a)` and `B(b)`, -~~~ +~~~ignore Struct(~[FieldInfo { span: <span of `int`>, name: None, @@ -126,7 +126,7 @@ Struct(~[FieldInfo { When generating the `expr` for a call with `self == C0(a)` and `other == C0(b)`, the SubstructureFields is -~~~ +~~~ignore EnumMatching(0, <ast::Variant for C0>, ~[FieldInfo { span: <span of int> @@ -138,7 +138,7 @@ EnumMatching(0, <ast::Variant for C0>, For `C1 {x}` and `C1 {x}`, -~~~ +~~~ignore EnumMatching(1, <ast::Variant for C1>, ~[FieldInfo { span: <span of x> @@ -150,7 +150,7 @@ EnumMatching(1, <ast::Variant for C1>, For `C0(a)` and `C1 {x}` , -~~~ +~~~ignore EnumNonMatching(~[(0, <ast::Variant for B0>, ~[(<span of int>, None, <expr for &a>)]), (1, <ast::Variant for B1>, @@ -164,7 +164,7 @@ EnumNonMatching(~[(0, <ast::Variant for B0>, A static method on the above would result in, -~~~~ +~~~~ignore StaticStruct(<ast::StructDef of A>, Named(~[(<ident of x>, <span of x>)])) StaticStruct(<ast::StructDef of B>, Unnamed(~[<span of x>])) @@ -346,7 +346,9 @@ impl<'a> TraitDef<'a> { * Given that we are deriving a trait `Tr` for a type `T<'a, ..., * 'z, A, ..., Z>`, creates an impl like: * + * ```ignore * impl<'a, ..., 'z, A:Tr B1 B2, ..., Z: Tr B1 B2> Tr for T<A, ..., Z> { ... } + * ``` * * where B1, B2, ... are the bounds given by `bounds_paths`.' * @@ -620,7 +622,7 @@ impl<'a> MethodDef<'a> { } /** - ~~~ + ~~~ignore #[deriving(Eq)] struct A { x: int, y: int } @@ -719,7 +721,7 @@ impl<'a> MethodDef<'a> { } /** - ~~~ + ~~~ignore #[deriving(Eq)] enum A { A1 @@ -762,7 +764,7 @@ impl<'a> MethodDef<'a> { /** Creates the nested matches for an enum definition recursively, i.e. - ~~~ + ~~~ignore match self { Variant1 => match other { Variant1 => matching, Variant2 => nonmatching, ... }, Variant2 => match other { Variant1 => nonmatching, Variant2 => matching, ... }, @@ -1166,7 +1168,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 f(cx, span, ~[self_1.method(__arg_1_1, __arg_2_1), self_2.method(__arg_1_2, __arg_2_2)]) ~~~ |
