Skip to content

I may have found a bug in rustc #25828

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
delehef opened this issue May 27, 2015 · 1 comment
Closed

I may have found a bug in rustc #25828

delehef opened this issue May 27, 2015 · 1 comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@delehef
Copy link

delehef commented May 27, 2015

I'm playing with parallelism, and rustc gave me this error:

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]`

As 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 :)

If I may help you by providing any informations, please do not hesitate to ask.

I tried this code:

struct ExtendedHSPs {
    query_pos: i64,
    bank_pos: i64,
    extension: i32,
    score: i32,
}

[...]
    let NB_CPU: usize = 4;
    let total_size: usize = query_candidates.len();
    let slice_size: usize = total_size/NB_CPU;
    let (tx, rx) = mpsc::channel();

    for cpu in 0..NB_CPU {
        let bottom = cpu*slice_size;
        let top = if cpu+1 == NB_CPU {total_size} else {(cpu+1)*slice_size};

        let my_tx = tx.clone();
        thread::spawn(move || {
            let mut my_HSPs = Vec::new();
            my_tx.send(my_HSPs);
        });
    }

    drop(tx);
    let HSPs: Vec<_> = rx.iter().collect();
[...]

Meta

rustc --version --verbose:

rustc 1.1.0-nightly (e5394240a 2015-05-14) (built 2015-05-14)
binary: rustc
commit-hash: e5394240a295650b567aa406b4a0e1e3a6749a5f
commit-date: 2015-05-14
build-date: 2015-05-14
host: x86_64-unknown-linux-gnu // <-- Archlinux here
release: 1.1.0-nightly

Backtrace:

⟩ env RUST_BACKTRACE=1 cargo rustc
   Compiling fblast v0.1.0 (file:///XXX)
src/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]`
src/main.rs:106         thread::spawn(move || {
                        ^~~~~~~~~~~~~
note: in expansion of for loop expansion
src/main.rs:101:5: 110:6 note: expansion site
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:170

stack backtrace:
   1:     0x7fba53543d89 - sys::backtrace::write::h07c95d531f9fe9d4uhs
   2:     0x7fba5354bd09 - panicking::on_panic::he918792f8f4677b8xXw
   3:     0x7fba5350bab2 - rt::unwind::begin_unwind_inner::h31a101974d18f246HCw
   4:     0x7fba508f544d - rt::unwind::begin_unwind::h14624462634262488443
   5:     0x7fba508f53e2 - diagnostic::SpanHandler::span_bug::hafd58c40d711da9f02B
   6:     0x7fba514fe073 - middle::traits::error_reporting::report_fulfillment_errors::h1a1d53ad0f7d9f52WTN
   7:     0x7fba52cafc44 - check::FnCtxt<'a, 'tcx>::select_all_obligations_or_error::hdec1eabcd6932f1e0kp
   8:     0x7fba52d273f2 - check::check_bare_fn::h1721ecdc067e6448qun
   9:     0x7fba52d252d2 - check::CheckItemBodiesVisitor<'a, 'tcx>.Visitor<'tcx>::visit_item::h107d6f7848b9ff6btrn
  10:     0x7fba52de5d8a - check_crate::closure.38895
  11:     0x7fba52ddf620 - check_crate::h6d6254e7cbd89310ZIC
  12:     0x7fba53a9adc8 - driver::phase_3_run_analysis_passes::hd8a391a642e4490etGa
  13:     0x7fba53a7c0cc - driver::compile_input::hb2b273f3b108679aQba
  14:     0x7fba53b37801 - run_compiler::h0564a7d54aad01e375b
  15:     0x7fba53b35052 - boxed::F.FnBox<A>::call_box::h13361673564817623969
  16:     0x7fba53b34619 - rt::unwind::try::try_fn::h2560773790993423171
  17:     0x7fba535c4a98 - rust_try_inner
  18:     0x7fba535c4a85 - rust_try
  19:     0x7fba53b348b4 - boxed::F.FnBox<A>::call_box::h12559150340170776261
  20:     0x7fba5354aaa1 - sys::thread::Thread::new::thread_start::h9c8d6fd462521d203Iv
  21:     0x7fba4d5f7353 - start_thread
  22:     0x7fba5319bbfc - __clone
  23:                0x0 - <unknown>
@arielb1
Copy link
Contributor

arielb1 commented May 27, 2015

This seems like a duplicate of #25368

@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label May 27, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants