Skip to content

"coherence failed to report ambiguity" ICE #23336

Closed
@frankmcsherry

Description

@frankmcsherry

The following ICEs for me (full ICE text below):

use communication::channels::Data;

pub trait UnaryLogic {
    type D: Data;
}

pub struct Test<D: Data> {
    data: D,
}

pub struct UnaryScope<L: UnaryLogic> {
    input: Test<L::D>,
}

I get the following backtrace:

% cargo build
   Compiling timely v0.0.4 (file:///Users/mcsherry/Projects/timely-dataflow)
src/example/unary.rs:11:1: 13:2 error: internal compiler error: coherence failed to report ambiguity: cannot locate the impl of the trait `communication::channels::Data` for the type `<L as example::unary::UnaryLogic>::D`
src/example/unary.rs:11 pub struct UnaryScope<L: UnaryLogic> {
src/example/unary.rs:12     input:          Test<L::D>,
src/example/unary.rs:13 }
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>', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:129

stack backtrace:
   1:        0x1049b9892 - sys::backtrace::write::h7ca860691254c21a9EC
   2:        0x1049e2a94 - panicking::on_panic::h732e2bcc29cede42AyI
   3:        0x104900ad7 - rt::unwind::begin_unwind_inner::h1d9a458f1c8a477f9gI
   4:        0x1040c2d4e - rt::unwind::begin_unwind::h1806603646409102692
   5:        0x1040c2cfb - diagnostic::SpanHandler::span_bug::h5e5d13971cb26e4dEaB
   6:        0x101a77431 - middle::traits::error_reporting::report_fulfillment_errors::hec79282105dfc6c0WkM
   7:        0x10101fc26 - check::vtable::select_all_fcx_obligations_or_error::h4a9679ed212bc030AWb
   8:        0x1010a003b - check::wf::CheckTypeWellFormedVisitor<'ccx, 'tcx>::check_item_well_formed::h84e6bab21402d285QGk
   9:        0x1010aa051 - visit::walk_item::h9436359046113201614
  10:        0x1010aa05c - visit::walk_item::h9436359046113201614
  11:        0x1011a0cb8 - check_crate::closure.35769
  12:        0x10119b9a0 - check_crate::ha4e5273863a0bceeO3B
  13:        0x100ebfd77 - driver::phase_3_run_analysis_passes::h01b4fa77db9aaa7cmGa
  14:        0x100ea7a42 - driver::compile_input::h5df8247b96c8ac29Nba
  15:        0x100f6bc0e - run_compiler::hc5bb62c076e88e08u2b
  16:        0x100f69197 - thunk::F.Invoke<A, R>::invoke::h9769882432828023548
  17:        0x100f67cff - rt::unwind::try::try_fn::h14950367479488448221
  18:        0x104a60ee8 - rust_try_inner
  19:        0x104a60ed5 - rust_try
  20:        0x100f68517 - thunk::F.Invoke<A, R>::invoke::h9709853396428516555
  21:        0x1049cfb22 - sys::thread::thread_start::hf2283362513a44b5o0G
  22:     0x7fff8b4ad2fb - _pthread_body
  23:     0x7fff8b4ad278 - _pthread_start

Could not compile `timely`.

To learn more, run the command again with --verbose.

with

% cargo --version
cargo 0.0.1-pre-nightly (66849de 2015-03-10) (built 2015-03-11)

The Data trait is just some mash-up of other traits, off in another file. Not clear if this is a "you wrote bad code, but the compiler barfed telling you" or "nope; that should work". Seems like ICE probably not the right answer in either case, though! :D

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions