Skip to content

Commit 945ea05

Browse files
chris-morganalexcrichton
authored andcommitted
---
yaml --- r: 106493 b: refs/heads/try c: 37f6564 h: refs/heads/master i: 106491: a7d82d6 v: v3
1 parent fa2ff33 commit 945ea05

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: b8ef9fd9c9f642ce7b8aed82782a1ed745d08d64
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b8601a3d8b91ad3b653d143307611f2f5c75617e
5-
refs/heads/try: c5fbc5048b805c57671582d70083240617b75c31
5+
refs/heads/try: 37f6564a8498cedd88b230abde3da1e75c6e4fd1
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libsyntax/ext/deriving/decodable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
/*!
12-
The compiler code necessary for #[deriving(Decodable)]. See
12+
The compiler code necessary for `#[deriving(Decodable)]`. See
1313
encodable.rs for more.
1414
*/
1515

branches/try/src/libsyntax/ext/deriving/encodable.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010

1111
/*!
1212
13-
The compiler code necessary to implement the #[deriving(Encodable)]
14-
(and Decodable, in decodable.rs) extension. The idea here is that
15-
type-defining items may be tagged with #[deriving(Encodable,
16-
Decodable)].
13+
The compiler code necessary to implement the `#[deriving(Encodable)]`
14+
(and `Decodable`, in decodable.rs) extension. The idea here is that
15+
type-defining items may be tagged with `#[deriving(Encodable, Decodable)]`.
1716
1817
For example, a type like:
1918
2019
```ignore
21-
#[deriving(Encodable, Decodable)]
22-
struct Node {id: uint}
20+
#[deriving(Encodable, Decodable)]
21+
struct Node { id: uint }
2322
```
2423
2524
would generate two implementations like:
2625
26+
```ignore
2727
impl<S:serialize::Encoder> Encodable<S> for Node {
2828
fn encode(&self, s: &S) {
2929
s.emit_struct("Node", 1, || {
@@ -41,13 +41,14 @@ impl<D:Decoder> Decodable for node_id {
4141
})
4242
}
4343
}
44+
```
4445
4546
Other interesting scenarios are whe the item has type parameters or
4647
references other non-built-in types. A type definition like:
4748
4849
```ignore
49-
#[deriving(Encodable, Decodable)]
50-
struct spanned<T> {node: T, span: Span}
50+
#[deriving(Encodable, Decodable)]
51+
struct spanned<T> { node: T, span: Span }
5152
```
5253
5354
would yield functions like:

branches/try/src/libsyntax/ext/deriving/generic.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ access to the fields of the 4 different sorts of structs and enum
1616
variants, as well as creating the method and impl ast instances.
1717
1818
Supported features (fairly exhaustive):
19+
1920
- Methods taking any number of parameters of any type, and returning
2021
any type, other than vectors, bottom and closures.
2122
- Generating `impl`s for types with type parameters and lifetimes
@@ -59,7 +60,7 @@ associated with. It is only not `None` when the associated field has
5960
an identifier in the source code. For example, the `x`s in the
6061
following snippet
6162
62-
~~~notrust
63+
```rust
6364
struct A { x : int }
6465
6566
struct B(int);
@@ -68,7 +69,7 @@ enum C {
6869
C0(int),
6970
C1 { x: int }
7071
}
71-
~~~
72+
```
7273
7374
The `int`s in `B` and `C0` don't have an identifier, so the
7475
`Option<ident>`s would be `None` for them.
@@ -83,7 +84,7 @@ variants, it is represented as a count of 0.
8384
8485
The following simplified `Eq` is used for in-code examples:
8586
86-
~~~notrust
87+
```rust
8788
trait Eq {
8889
fn eq(&self, other: &Self);
8990
}
@@ -92,7 +93,7 @@ impl Eq for int {
9293
*self == *other
9394
}
9495
}
95-
~~~
96+
```
9697
9798
Some examples of the values of `SubstructureFields` follow, using the
9899
above `Eq`, `A`, `B` and `C`.

branches/try/src/libsyntax/ext/deriving/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
// except according to those terms.
1010

1111
/*!
12-
The compiler code necessary to implement the #[deriving] extensions.
12+
The compiler code necessary to implement the `#[deriving]` extensions.
1313
1414
15-
FIXME (#2810)--Hygiene. Search for "__" strings (in other files too).
15+
FIXME (#2810): hygiene. Search for "__" strings (in other files too).
1616
We also assume "extra" is the standard library, and "std" is the core
1717
library.
1818

0 commit comments

Comments
 (0)