mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
14 lines
265 B
Rust
14 lines
265 B
Rust
use std::sync::mpsc::channel;
|
|
use std::thread;
|
|
|
|
fn main() {
|
|
let (tx, rx) = channel();
|
|
let _t = thread::spawn(move|| -> () {
|
|
loop {
|
|
let tx = tx;
|
|
//~^ ERROR: use of moved value: `tx`
|
|
tx.send(1);
|
|
}
|
|
});
|
|
}
|