{"action":"closed","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/17308","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/17308/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/17308/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/17308/events","html_url":"https://github.com/rust-lang/rust/issues/17308","id":42907270,"number":17308,"title":"Thread crashes if Receiver is used","user":{"login":"vhbit","id":140199,"avatar_url":"https://avatars.githubusercontent.com/u/140199?v=3","gravatar_id":"","url":"https://api.github.com/users/vhbit","html_url":"https://github.com/vhbit","followers_url":"https://api.github.com/users/vhbit/followers","following_url":"https://api.github.com/users/vhbit/following{/other_user}","gists_url":"https://api.github.com/users/vhbit/gists{/gist_id}","starred_url":"https://api.github.com/users/vhbit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vhbit/subscriptions","organizations_url":"https://api.github.com/users/vhbit/orgs","repos_url":"https://api.github.com/users/vhbit/repos","events_url":"https://api.github.com/users/vhbit/events{/privacy}","received_events_url":"https://api.github.com/users/vhbit/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-09-16T17:12:30Z","updated_at":"2015-01-27T17:45:44Z","closed_at":"2015-01-27T17:45:44Z","body":"Here is a test case:\r\n\r\n``` rust\r\nuse std::rt::thread::Thread;\r\n\r\nfn write_loop(rx: Receiver<uint>) {\r\n    loop {\r\n        match rx.recv_opt() {\r\n            Ok(v) => println!(\"v {}\", v),\r\n            _ => break\r\n        }\r\n    }\r\n}\r\n\r\nfn main() {\r\n    let (tx, rx) = channel();\r\n    Thread::start(proc() {\r\n        write_loop(rx);\r\n    });\r\n    \r\n    tx.send(3u);\r\n}\r\n```\r\n\r\nOutput: `fatal runtime error:  assertion failed: !ptr.is_null()`\r\n\r\nI guess that's because there is no `Task` associated with thread and while it is possible to create a task manually - there is no known for me way to put `Runtime` into it. \r\n\r\nConsidering there is no direct way to guess what for this thread is created and whether it should use native runtime or not, it is reasonable. But it is still quite unexpected, so I believe there should be either a way to put runtime into it or documentation of `Receiver` should note that more clearly. "}}