From 278b487cabcbe52b301a8023cd1362045b1a7132 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 6 May 2013 19:29:04 -0700 Subject: test: Fix tests and the pipe compiler --- src/libsyntax/ext/pipes/pipec.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/libsyntax/ext') 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!({ -- cgit 1.4.1-3-g733a5