Skip to content

Instantly share code, notes, and snippets.

rust: "+++ trans_arg_expr on {|move a|\n let mut live = true;\n let terminate = port();\n let get = port();\n c.send((chan(terminate), chan(get)));\n while live {\n alt comm::select2(terminate, get) {\n either::left(()) { live = false; }\n either::right(cc) { comm::send(cc, arc::clone(&a)); }\n }\n }\n}"
rust: "new insn_ctxt: trans_arg_expr"
rust: "new insn_ctxt: trans_temp_lval"
rust: "new insn_ctxt: alloc_ty"
rust: "new insn_ctxt: alloca"
rust: "new insn_ctxt: trans_expr"
rust: "translating fn_block {|move a|\n let mut live = true;\n let terminate = port();\n let get = port();\n c.send((chan(terminate), chan(get)));\n while live {\n alt comm::select2(terminate, get) {\n either::left(()) { live = false; }\n either::right(cc) { comm::send(cc, arc::clone(&a)); }\n }\n }\n} with type fn~()"
rust: "new insn_ctxt: closure::trans_expr_fn"
rust: "register_fn_fuller created fn *fn(*i1, addrspace(1)*{i64, *tydesc, *typ
diff --git a/src/librustsyntax/fold.rs b/src/librustsyntax/fold.rs
index 9a6afd8..12fd705 100644
--- a/src/librustsyntax/fold.rs
+++ b/src/librustsyntax/fold.rs
@@ -427,8 +427,11 @@ fn noop_fold_expr(e: expr_, fld: ast_fold) -> expr_ {
expr_alt(fld.fold_expr(expr), vec::map(arms, fld.fold_arm), mode)
}
expr_fn(proto, decl, body, captures) {
- expr_fn(proto, fold_fn_decl(decl, fld),
- fld.fold_block(body), captures)
task::spawn {|move lock2|
let lock = arc::get(&lock2);
(*lock).lock_cond {|c|
c.wait();
}
}
// lock should be a & reference to one of these:
resource lock_and_signal(lock: rust_cond_lock) {
for uint::range(1u, num_tasks) {|i|
let get_chan = port();
let get_chan_chan = chan(get_chan);
{
let num_chan = num_chan.clone();
futures += [future::spawn {|move num_chan, move get_chan_chan|
let p = port();
get_chan_chan.send(chan(p));
thread_ring(i, msg_per_task, num_chan, p)
}];
diff --git a/src/rustc/middle/trans/base.rs b/src/rustc/middle/trans/base.rs
index 2423f04..4484087 100644
--- a/src/rustc/middle/trans/base.rs
+++ b/src/rustc/middle/trans/base.rs
@@ -1439,6 +1439,7 @@ fn copy_val_no_check(bcx: block, action: copy_action, dst: ValueRef,
// doesn't need to be dropped. (Issue #839)
fn move_val(cx: block, action: copy_action, dst: ValueRef,
src: lval_result, t: ty::t) -> block {
+ assert !cx.terminated;
let _icx = cx.insn_ctxt("move_val");
#proto notifier {
state notify {
send_notification(status) -> notified;
}
state notified { }
}
[host-5-154:build eholk]$ time make check-stage1-std
cfg: shell host triple x86_64-apple-darwin
cfg: host for x86_64-apple-darwin is x86_64
cfg: unix-y environment
cfg: using gcc
cfg: disabling valgrind (CFG_DISABLE_VALGRIND)
cfg: no node found, omitting doc/tutorial.html
cfg: no node found, omitting doc/tutorial.html
cfg: no llnextgen found, omitting grammar-verification
cfg: including dist rules
mod pipes {
import unsafe::{forget, reinterpret_cast};
enum state {
empty,
full,
blocked,
terminated
}
mod pingpong {
enum ping { ping, }
enum ping_message = *pipes::packet<pong_message>;
enum pong { pong, }
enum pong_message = *pipes::packet<ping_message>;
fn init() -> (client::ping, server::ping) {
pipes::entangle()
}
/Users/eholk/Documents/projects/mozilla/rust/src/test/bench/msgsend-ring-contracts.rs:229:22: 229:23 warning: value assigned to `y` is never read
/Users/eholk/Documents/projects/mozilla/rust/src/test/bench/msgsend-ring-contracts.rs:229 unsafe { let y <- *ptr::addr_of(x); y }