Skip to content

internal compiler error: coherence failed to report ambiguity #17593

Closed
@smangelsdorf

Description

@smangelsdorf

Arch Linux, x86_64, rustc 0.12.0-nightly (2550243b4 2014-09-25 19:02:44 +0000)

Code: https://github.com/smangelsdorf/rustircd/tree/rust-bug-2014-09-28

I didn't expect this to compile successfully, but when I tried I hit an error which asked me nicely to report it as a compiler bug 😄

   Compiling irc v0.0.1 (file:///home/shaun/Projects/rustircd)
     Running `rustc /home/shaun/Projects/rustircd/src/lib.rs --crate-name irc --crate-type lib -g -C metadata=921da4c2884c0d8a -C extra-filename=-921da4c2884c0d8a --out-dir /home/shaun/Projects/rustircd/target --dep-info /home/shaun/Projects/rustircd/target/.fingerprint/irc-921da4c2884c0d8a/dep-lib-irc -L /home/shaun/Projects/rustircd/target -L /home/shaun/Projects/rustircd/target/deps`
/home/shaun/Projects/rustircd/src/protocol.rs:40:1: 49:2 error: internal compiler error: coherence failed to report ambiguity: cannot locate the impl of the trait `std::to_string::ToString` for the type `protocol::Message`
/home/shaun/Projects/rustircd/src/protocol.rs:40 impl ToString for Message {
/home/shaun/Projects/rustircd/src/protocol.rs:41   pub fn to_string(&self) -> String {
/home/shaun/Projects/rustircd/src/protocol.rs:42     let prefix = match self.prefix {
/home/shaun/Projects/rustircd/src/protocol.rs:43       Some(p) => format!("{} ", p),
/home/shaun/Projects/rustircd/src/protocol.rs:44       None => ""
/home/shaun/Projects/rustircd/src/protocol.rs:45     };
                                                 ...
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/diagnostic.rs:113

stack backtrace:
   1:     0x7f6c444af740 - rt::backtrace::imp::write::heebf58b6ac691aa6vUq
   2:     0x7f6c444b2900 - failure::on_fail::h204692c9d758e6bbXfr
   3:     0x7f6c48bb62d0 - unwind::begin_unwind_inner::h5df2dc6f14b19f71MTd
   4:     0x7f6c45498300 - unwind::begin_unwind::h8062016494710735250
   5:     0x7f6c45498280 - diagnostic::SpanHandler::span_bug::h810a8fac103d8c1cMhF
   6:     0x7f6c493cb730 - driver::session::Session::span_bug::h4fe48100859a9b95X8w
   7:     0x7f6c4971c8d0 - middle::typeck::check::vtable2::maybe_report_ambiguity::hb41748e8ca32dea0wZK
   8:     0x7f6c4971b380 - middle::typeck::check::vtable2::select_all_fcx_obligations_or_error::h5d06e209d4c847650PK
   9:     0x7f6c497640f0 - middle::typeck::check::wf::CheckTypeWellFormedVisitor<'ccx, 'tcx>::with_fcx::h7fd352e50fe32cd56uR
  10:     0x7f6c49766fc0 - middle::typeck::check::wf::CheckTypeWellFormedVisitor<'ccx, 'tcx>.Visitor<'v>::visit_item::hf6ef6d90ff6395b4pER
  11:     0x7f6c49766fc0 - middle::typeck::check::wf::CheckTypeWellFormedVisitor<'ccx, 'tcx>.Visitor<'v>::visit_item::hf6ef6d90ff6395b4pER
  12:     0x7f6c4976d770 - middle::typeck::check::check_item_types::hbc5ac40f3d3cae1ap8R
  13:     0x7f6c4921c4b0 - util::common::time::h5723798609349898350
  14:     0x7f6c49a14ad0 - middle::typeck::check_crate::h5732ccea6ca40e95FVj
  15:     0x7f6c49a7e600 - driver::driver::phase_3_run_analysis_passes::h5c6d0a55804972d1pqw
  16:     0x7f6c49a79d50 - driver::driver::compile_input::hd84cb07887cabc36m7v
  17:     0x7f6c49afc000 - driver::run_compiler::h0b16c0ac7a7e28ceeXz
  18:     0x7f6c49afbee0 - driver::main_args::closure.145992
  19:     0x7f6c492355f0 - task::TaskBuilder<S>::try_future::closure.101285
  20:     0x7f6c492353e0 - task::TaskBuilder<S>::spawn_internal::closure.101256
  21:     0x7f6c48f05650 - task::spawn_opts::closure.8485
  22:     0x7f6c48c0c480 - rust_try_inner
  23:     0x7f6c48c0c470 - rust_try
  24:     0x7f6c48bb3910 - unwind::try::h8c8d3e6eb0ca16a6uId
  25:     0x7f6c48bb3770 - task::Task::run::hfb873359c59e1424cYc
  26:     0x7f6c48f053c0 - task::spawn_opts::closure.8425
  27:     0x7f6c48bb5360 - thread::thread_start::h2b0150e66287e12frid
  28:     0x7f6c43857060 - start_thread
  29:     0x7f6c48883489 - __clone
  30:                0x0 - <unknown>

Could not compile `irc`.

Caused by:
  Process didn't exit successfully: `rustc /home/shaun/Projects/rustircd/src/lib.rs --crate-name irc --crate-type lib -g -C metadata=921da4c2884c0d8a -C extra-filename=-921da4c2884c0d8a --out-dir /home/shaun/Projects/rustircd/target --dep-info /home/shaun/Projects/rustircd/target/.fingerprint/irc-921da4c2884c0d8a/dep-lib-irc -L /home/shaun/Projects/rustircd/target -L /home/shaun/Projects/rustircd/target/deps` (status=101)

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