diff options
| author | bors <bors@rust-lang.org> | 2013-09-25 15:40:52 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-09-25 15:40:52 -0700 |
| commit | 41826c48eddfb964b830229dff6f0480ac649827 (patch) | |
| tree | b072ac06adc084acd477fb8f90971e79497313b7 /src/libsyntax/ext | |
| parent | 24d46a0f45b4a0d6198b9d23dad2f7faa5a05d92 (diff) | |
| parent | 3d5873fa421356ad936e6fc6ab61773c60646357 (diff) | |
| download | rust-41826c48eddfb964b830229dff6f0480ac649827.tar.gz rust-41826c48eddfb964b830229dff6f0480ac649827.zip | |
auto merge of #9475 : alexcrichton/rust/rustdoc++, r=cmr
The commit messages are a good technical summary, a good visual summary (contrib is this version): Pub use statements now rendered. Notice how almost all components are also clickable! * http://static.rust-lang.org/doc/master/std/prelude/index.html * http://www.contrib.andrew.cmu.edu/~acrichto/doc/std/prelude/index.html Private things hidden by default (for at least some approximation of privacy). I hope to improve this once privacy is totally ironed out. * http://static.rust-lang.org/doc/master/std/hashmap/struct.HashMap.html * http://www.contrib.andrew.cmu.edu/~acrichto/doc/std/hashmap/struct.HashMap.html Unindentation now works properly: * http://static.rust-lang.org/doc/master/extra/getopts/index.html * http://www.contrib.andrew.cmu.edu/~acrichto/doc/extra/getopts/index.html Also sundown has massively reduced compilation time (of docs, not the of the crates)
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/deriving/generic.rs | 44 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 4 |
2 files changed, 24 insertions, 24 deletions
diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs index 9222d8160ee..646b65d080b 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 -~~~ + ``` struct A { x : int } struct B(int); @@ -82,7 +82,7 @@ represented as a count of 0. The following simplified `Eq` is used for in-code examples: -~~~ + ``` trait Eq { fn eq(&self, other: &Self); } @@ -91,7 +91,7 @@ impl Eq for int { *self == *other } } -~~~ + ``` Some examples of the values of `SubstructureFields` follow, using the above `Eq`, `A`, `B` and `C`. @@ -100,50 +100,50 @@ above `Eq`, `A`, `B` and `C`. When generating the `expr` for the `A` impl, the `SubstructureFields` is -~~~ + ``` Struct(~[(Some(<ident of x>), <expr for &self.x>, ~[<expr for &other.x])]) -~~~ + ``` For the `B` impl, called with `B(a)` and `B(b)`, -~~~ + ``` Struct(~[(None, <expr for &a> ~[<expr for &b>])]) -~~~ + ``` ## Enums When generating the `expr` for a call with `self == C0(a)` and `other == C0(b)`, the SubstructureFields is -~~~ + ``` EnumMatching(0, <ast::variant for C0>, ~[None, <expr for &a>, ~[<expr for &b>]]) -~~~ + ``` For `C1 {x}` and `C1 {x}`, -~~~ + ``` EnumMatching(1, <ast::variant for C1>, ~[Some(<ident of x>), <expr for &self.x>, ~[<expr for &other.x>]]) -~~~ + ``` For `C0(a)` and `C1 {x}` , -~~~ + ``` EnumNonMatching(~[(0, <ast::variant for B0>, ~[(None, <expr for &a>)]), (1, <ast::variant for B1>, ~[(Some(<ident of x>), <expr for &other.x>)])]) -~~~ + ``` (and vice versa, but with the order of the outermost list flipped.) @@ -158,7 +158,7 @@ StaticStruct(<ast::struct_def of B>, Left(1)) StaticEnum(<ast::enum_def of C>, ~[(<ident of C0>, Left(1)), (<ident of C1>, Right(~[<ident of x>]))]) -~~~ + ``` */ @@ -547,7 +547,7 @@ impl<'self> MethodDef<'self> { } /** - ~~~ + ``` #[deriving(Eq)] struct A { x: int, y: int } @@ -565,7 +565,7 @@ impl<'self> MethodDef<'self> { } } } - ~~~ + ``` */ fn expand_struct_method_body(&self, cx: @ExtCtxt, @@ -638,7 +638,7 @@ impl<'self> MethodDef<'self> { } /** - ~~~ + ``` #[deriving(Eq)] enum A { A1 @@ -661,7 +661,7 @@ impl<'self> MethodDef<'self> { } } } - ~~~ + ``` */ fn expand_enum_method_body(&self, cx: @ExtCtxt, @@ -681,13 +681,13 @@ impl<'self> MethodDef<'self> { /** Creates the nested matches for an enum definition recursively, i.e. - ~~~ + ``` match self { Variant1 => match other { Variant1 => matching, Variant2 => nonmatching, ... }, Variant2 => match other { Variant1 => nonmatching, Variant2 => matching, ... }, ... } - ~~~ + ``` It acts in the most naive way, so every branch (and subbranch, subsubbranch, etc) exists, not just the ones where all the variants in @@ -1058,10 +1058,10 @@ 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. -~~~ + ``` f(cx, span, ~[self_1.method(__arg_1_1, __arg_2_1), self_2.method(__arg_1_2, __arg_2_2)]) -~~~ + ``` */ #[inline] pub fn cs_same_method(f: &fn(@ExtCtxt, Span, ~[@Expr]) -> @Expr, diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 64f30803ca7..61c9ea7be14 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -944,7 +944,7 @@ pub fn std_macros() -> @str { # Example - ~~~ {.rust} + ```rust fn choose_weighted_item(v: &[Item]) -> Item { assert!(!v.is_empty()); let mut so_far = 0u; @@ -958,7 +958,7 @@ pub fn std_macros() -> @str { // type checker that it isn't possible to get down here unreachable!(); } - ~~~ + ``` */ macro_rules! unreachable (() => ( |
