Skip to content

Commit 28f6ebc

Browse files
committed
---
yaml --- r: 41553 b: refs/heads/master c: 1330b1c h: refs/heads/master i: 41551: 42711f3 v: v3
1 parent a7d1b9a commit 28f6ebc

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 1bc51f172863bf9731f39b71e2e6a6db76707aa5
2+
refs/heads/master: 1330b1cdf569f8ea5eaec74301125fde32884d62
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
struct HTMLImageData {
2+
mut image: Option<~str>
3+
}
4+
5+
struct ElementData {
6+
kind: ~ElementKind
7+
}
8+
9+
enum ElementKind {
10+
HTMLImageElement(HTMLImageData)
11+
}
12+
13+
enum NodeKind {
14+
Element(ElementData)
15+
}
16+
17+
enum NodeData = {
18+
kind: ~NodeKind
19+
};
20+
21+
fn main() {
22+
let id = HTMLImageData { image: None };
23+
let ed = ElementData { kind: ~HTMLImageElement(id) };
24+
let n = NodeData({kind : ~Element(ed)});
25+
match n.kind {
26+
~Element(ed) => match ed.kind {
27+
~HTMLImageElement(d) if d.image.is_some() => { true }
28+
},
29+
_ => fail ~"WAT" //~ ERROR wat
30+
};
31+
}

trunk/src/test/run-pass/issue-3609.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
extern mod std;
2+
3+
use pipes::Chan;
4+
5+
type RingBuffer = ~[float];
6+
type SamplesFn = fn~ (samples: &RingBuffer);
7+
8+
enum Msg
9+
{
10+
GetSamples(~str, SamplesFn), // sample set name, callback which receives samples
11+
}
12+
13+
fn foo(name: ~str, samples_chan: Chan<Msg>) {
14+
do task::spawn
15+
|copy name|
16+
{
17+
let callback: SamplesFn =
18+
|buffer|
19+
{
20+
for uint::range(0, buffer.len())
21+
|i| {error!("%?: %f", i, buffer[i])}
22+
};
23+
samples_chan.send(GetSamples(copy name, callback));
24+
};
25+
}
26+
27+
fn main() {}
28+

0 commit comments

Comments
 (0)