summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-05-06 19:29:04 -0700
committerPatrick Walton <pcwalton@mimiga.net>2013-05-08 17:04:00 -0700
commit278b487cabcbe52b301a8023cd1362045b1a7132 (patch)
treed72884e73791fcb1dc015db22e92569764ebae6f /src/libsyntax/ext
parentdb4573a7760bd2014b2eca2537b6af15a9803e3d (diff)
downloadrust-278b487cabcbe52b301a8023cd1362045b1a7132.tar.gz
rust-278b487cabcbe52b301a8023cd1362045b1a7132.zip
test: Fix tests and the pipe compiler
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/pipes/pipec.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs
index 00a91bdc46e..7ac3ea4789d 100644
--- a/src/libsyntax/ext/pipes/pipec.rs
+++ b/src/libsyntax/ext/pipes/pipec.rs
@@ -64,6 +64,7 @@ impl gen_send for message {
 
             let mut body = ~"{\n";
             body += fmt!("use super::%s;\n", name);
+            body += ~"let mut pipe = pipe;\n";
 
             if this.proto.is_bounded() {
                 let (sp, rp) = match (this.dir, next.dir) {
@@ -73,12 +74,12 @@ impl gen_send for message {
                   (recv, recv) => (~"c", ~"s")
                 };
 
-                body += ~"let b = pipe.reuse_buffer();\n";
+                body += ~"let mut b = pipe.reuse_buffer();\n";
                 body += fmt!("let %s = ::core::pipes::SendPacketBuffered(\
-                              &(b.buffer.data.%s));\n",
+                              &mut (b.buffer.data.%s));\n",
                              sp, next.name);
                 body += fmt!("let %s = ::core::pipes::RecvPacketBuffered(\
-                              &(b.buffer.data.%s));\n",
+                              &mut (b.buffer.data.%s));\n",
                              rp, next.name);
             }
             else {
@@ -366,7 +367,7 @@ impl gen_init for protocol {
                         fmt!("data.%s.set_buffer(buffer)",
                              s.name))),
                 ext_cx.parse_expr(fmt!(
-                    "::core::ptr::to_unsafe_ptr(&(data.%s))",
+                    "::core::ptr::to_mut_unsafe_ptr(&mut (data.%s))",
                     self.states[0].name))));
 
         quote_expr!({