Skip to content

Commit ecd0e2a

Browse files
committed
---
yaml --- r: 23262 b: refs/heads/master c: 913f7bd h: refs/heads/master v: v3
1 parent 469f230 commit ecd0e2a

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: e1b11aaf4b44152317e1607a959100c12bf24c54
2+
refs/heads/master: 913f7bdae744f88110eaca73fb28e4b8e987456c
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/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]

trunk/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)