2014-04-08 23:59:18 +00:00
|
|
|
// 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.
|
|
|
|
|
2014-12-23 19:53:35 +00:00
|
|
|
use std::sync::mpsc::channel;
|
2014-12-22 17:04:23 +00:00
|
|
|
use std::thread::Thread;
|
|
|
|
|
2014-04-08 23:59:18 +00:00
|
|
|
fn main() {
|
|
|
|
let (tx, rx) = channel();
|
2014-12-22 17:04:23 +00:00
|
|
|
let _t = Thread::spawn(move|| -> () {
|
2014-04-08 23:59:18 +00:00
|
|
|
loop {
|
|
|
|
let tx = tx;
|
|
|
|
//~^ ERROR: use of moved value: `tx`
|
2015-01-08 11:05:56 +00:00
|
|
|
tx.send(1is);
|
2014-04-08 23:59:18 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|