diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-12041.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-12041.rs b/src/test/ui/issues/issue-12041.rs new file mode 100644 index 000000000..091e8fe8b --- /dev/null +++ b/src/test/ui/issues/issue-12041.rs @@ -0,0 +1,13 @@ +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); + } + }); +} |