Skip to content

Commit 5f8ccec

Browse files
committed
---
yaml --- r: 29862 b: refs/heads/incoming c: 913f7bd h: refs/heads/master v: v3
1 parent 1ce073c commit 5f8ccec

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: e1b11aaf4b44152317e1607a959100c12bf24c54
9+
refs/heads/incoming: 913f7bdae744f88110eaca73fb28e4b8e987456c
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/pipes.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ export stream, port, chan, shared_chan, port_set, channel;
9797
export oneshot, chan_one, port_one;
9898
export recv_one, try_recv_one, send_one, try_send_one;
9999

100+
// Functions used by the protocol compiler
101+
export rt;
102+
100103
#[doc(hidden)]
101104
const SPIN_COUNT: uint = 0;
102105

@@ -1194,6 +1197,13 @@ fn try_send_one<T: send>(+chan: chan_one<T>, +data: T)
11941197
oneshot::client::try_send(chan, data).is_some()
11951198
}
11961199

1200+
mod rt {
1201+
// These are used to hide the option constructors from the
1202+
// compiler because their names are changing
1203+
fn make_some<T>(+val: T) -> option<T> { some(val) }
1204+
fn make_none<T>() -> option<T> { none }
1205+
}
1206+
11971207
#[cfg(test)]
11981208
mod test {
11991209
#[test]

branches/incoming/src/libsyntax/ext/pipes/pipec.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ impl message: gen_send {
104104
}
105105
else {
106106
body += fmt!("if pipes::send(pipe, message) {\n \
107-
some(c) \
108-
} else { none } }");
107+
pipes::rt::make_some(c) \
108+
} else { pipes::rt::make_none() } }");
109109
}
110110

111111
let body = cx.parse_expr(body);
@@ -163,8 +163,8 @@ impl message: gen_send {
163163
body += ~" }";
164164
} else {
165165
body += fmt!("if pipes::send(pipe, message) { \
166-
some(()) \
167-
} else { none } }");
166+
pipes::rt::make_some(()) \
167+
} else { pipes::rt::make_none() } }");
168168
}
169169
170170
let body = cx.parse_expr(body);

0 commit comments

Comments
 (0)