Change:
compiles . Runs . Connection refused and segfault.
This is a bug in the treatment of captured variables. The line in question is: This is moving into the loop repeatedly when you should only be allowed to do it once. I think I've seen this bug before, but just in case, cc
thanks I've seen some reports of bugs like this before -- it's clear that we need to revisit the code used to check "once fns" -- it was as a temporary start towards support (under a -Z flag) and then pressed into full service, clearly not quite ready for prime time.
Nominating.
updated title to reflect the real issue at hand.
cc
Assigning 1.0, max(P-backcompat-lang, P-high). Gotta fix. edit: The use of above is sort of a joke: take the max of the two P-tag inputs. (Also, I originally wrote P-backcompat-libs, but I'm pretty sure that was a typo.)

Discussion:
match cmt.cat { mc::cat_rvalue(..) | mc::cat_static_item | <del> mc::cat_copied_upvar(_) => { </del> <ins> mc::cat_copied_upvar(mc::CopiedUpvar { onceness: ast::Many, .. }) => { </ins> None } mc::cat_local(id) | mc::cat_arg(id) | <ins> mc::cat_copied_upvar(mc::CopiedUpvar { upvar_id: id, .. }) | </ins> mc::cat_upvar(ty::UpvarId {var_id: id, ..}, _) => { Some(@LpVar(id)) }

<ins> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { let x = ~1; let f: proc() = proc() { let _a = x; drop(x); //~^ ERROR: use of moved value: `x` }; f(); } </ins>

fn main() { let r = { let x = ~42; <del> let f = proc() &x; //~ ERROR: borrowed value does not live long enough </del> <ins> let f = proc() &x; //~ ERROR: `x` does not live long enough </ins> f() };

<ins> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { let (tx, rx) = channel(); spawn(proc() { loop { let tx = tx; //~^ ERROR: use of moved value: `tx` tx.send(1); } }); } </ins>

<ins> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { let f = proc() {}; (proc() { f(); f(); //~^ ERROR: use of moved value: `f` })() } </ins>