{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/25828","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/25828/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/25828/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/25828/events","html_url":"https://github.com/rust-lang/rust/issues/25828","id":81539591,"number":25828,"title":"I may have found a bug in rustc","user":{"login":"delehef","id":1153808,"avatar_url":"https://avatars.githubusercontent.com/u/1153808?v=3","gravatar_id":"","url":"https://api.github.com/users/delehef","html_url":"https://github.com/delehef","followers_url":"https://api.github.com/users/delehef/followers","following_url":"https://api.github.com/users/delehef/following{/other_user}","gists_url":"https://api.github.com/users/delehef/gists{/gist_id}","starred_url":"https://api.github.com/users/delehef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delehef/subscriptions","organizations_url":"https://api.github.com/users/delehef/orgs","repos_url":"https://api.github.com/users/delehef/repos","events_url":"https://api.github.com/users/delehef/events{/privacy}","received_events_url":"https://api.github.com/users/delehef/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-27T17:19:03Z","updated_at":"2015-05-27T17:19:03Z","closed_at":null,"body":"I'm playing with parallelism, and rustc gave me this error:\r\n\r\n```\r\nerror: internal compiler error: coherence failed to report ambiguity: cannot locate the impl of the trait `core::marker::Send` for the type `[closure src/main.rs:106:28: 109:10]`\r\n```\r\nAs I'm not yet really experienced with rust, I'm not really sure it's the compiler fault, but I suppose false positives are better than hidden positives :)\r\n\r\nIf I may help you by providing any informations, please do not hesitate to ask.\r\n\r\nI tried this code:\r\n\r\n```\r\nstruct ExtendedHSPs {\r\n    query_pos: i64,\r\n    bank_pos: i64,\r\n    extension: i32,\r\n    score: i32,\r\n}\r\n\r\n[...]\r\n    let NB_CPU: usize = 4;\r\n    let total_size: usize = query_candidates.len();\r\n    let slice_size: usize = total_size/NB_CPU;\r\n    let (tx, rx) = mpsc::channel();\r\n\r\n    for cpu in 0..NB_CPU {\r\n        let bottom = cpu*slice_size;\r\n        let top = if cpu+1 == NB_CPU {total_size} else {(cpu+1)*slice_size};\r\n\r\n        let my_tx = tx.clone();\r\n        thread::spawn(move || {\r\n            let mut my_HSPs = Vec::new();\r\n            my_tx.send(my_HSPs);\r\n        });\r\n    }\r\n\r\n    drop(tx);\r\n    let HSPs: Vec<_> = rx.iter().collect();\r\n[...]\r\n```\r\n\r\n## Meta\r\n\r\n`rustc --version --verbose`: \r\n```\r\nrustc 1.1.0-nightly (e5394240a 2015-05-14) (built 2015-05-14)\r\nbinary: rustc\r\ncommit-hash: e5394240a295650b567aa406b4a0e1e3a6749a5f\r\ncommit-date: 2015-05-14\r\nbuild-date: 2015-05-14\r\nhost: x86_64-unknown-linux-gnu // <-- Archlinux here\r\nrelease: 1.1.0-nightly\r\n```\r\n\r\nBacktrace:\r\n\r\n```\r\n⟩ env RUST_BACKTRACE=1 cargo rustc\r\n   Compiling fblast v0.1.0 (file:///XXX)\r\nsrc/main.rs:106:9: 106:22 error: internal compiler error: coherence failed to report ambiguity: cannot locate the impl of the trait `core::marker::Send` for the type `[closure src/main.rs:106:28: 109:10]`\r\nsrc/main.rs:106         thread::spawn(move || {\r\n                        ^~~~~~~~~~~~~\r\nnote: in expansion of for loop expansion\r\nsrc/main.rs:101:5: 110:6 note: expansion site\r\nnote: the compiler unexpectedly panicked. this is a bug.\r\nnote: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports\r\nnote: run with `RUST_BACKTRACE=1` for a backtrace\r\nthread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:170\r\n\r\nstack backtrace:\r\n   1:     0x7fba53543d89 - sys::backtrace::write::h07c95d531f9fe9d4uhs\r\n   2:     0x7fba5354bd09 - panicking::on_panic::he918792f8f4677b8xXw\r\n   3:     0x7fba5350bab2 - rt::unwind::begin_unwind_inner::h31a101974d18f246HCw\r\n   4:     0x7fba508f544d - rt::unwind::begin_unwind::h14624462634262488443\r\n   5:     0x7fba508f53e2 - diagnostic::SpanHandler::span_bug::hafd58c40d711da9f02B\r\n   6:     0x7fba514fe073 - middle::traits::error_reporting::report_fulfillment_errors::h1a1d53ad0f7d9f52WTN\r\n   7:     0x7fba52cafc44 - check::FnCtxt<'a, 'tcx>::select_all_obligations_or_error::hdec1eabcd6932f1e0kp\r\n   8:     0x7fba52d273f2 - check::check_bare_fn::h1721ecdc067e6448qun\r\n   9:     0x7fba52d252d2 - check::CheckItemBodiesVisitor<'a, 'tcx>.Visitor<'tcx>::visit_item::h107d6f7848b9ff6btrn\r\n  10:     0x7fba52de5d8a - check_crate::closure.38895\r\n  11:     0x7fba52ddf620 - check_crate::h6d6254e7cbd89310ZIC\r\n  12:     0x7fba53a9adc8 - driver::phase_3_run_analysis_passes::hd8a391a642e4490etGa\r\n  13:     0x7fba53a7c0cc - driver::compile_input::hb2b273f3b108679aQba\r\n  14:     0x7fba53b37801 - run_compiler::h0564a7d54aad01e375b\r\n  15:     0x7fba53b35052 - boxed::F.FnBox<A>::call_box::h13361673564817623969\r\n  16:     0x7fba53b34619 - rt::unwind::try::try_fn::h2560773790993423171\r\n  17:     0x7fba535c4a98 - rust_try_inner\r\n  18:     0x7fba535c4a85 - rust_try\r\n  19:     0x7fba53b348b4 - boxed::F.FnBox<A>::call_box::h12559150340170776261\r\n  20:     0x7fba5354aaa1 - sys::thread::Thread::new::thread_start::h9c8d6fd462521d203Iv\r\n  21:     0x7fba4d5f7353 - start_thread\r\n  22:     0x7fba5319bbfc - __clone\r\n  23:                0x0 - <unknown>\r\n```"}}