Skip to content

ICE: Index out of bounds error after argument type mismatch. #18246

Closed
@michaelsproul

Description

@michaelsproul

I'm working on TrieMap at the moment, and hit an ICE when I passed an argument of the wrong type.

I don't have much experience with the compiler's internals, but here's a backtrace...

trie.rs:1703:25: 1703:29 error: mismatched types: expected `&trie::TrieNode<<generic #494>>`, found `&trie::TrieMap<uint>` (expected struct trie::TrieNode, found struct trie::TrieMap)
trie.rs:1703         check_integrity(&map);
                                     ^~~~
<std macros>:8:12: 1707:42 error: mismatched types: expected `bool`, found `uint` (expected bool, found uint)
<std macros>:8         if !$cond {
<std macros>:9             fail!($($arg),+)
<std macros>:10         }
<std macros>:11     );
<std macros>:12 )
error: internal compiler error: unexpected failure
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 'index out of bounds: the len is 12 but the index is 12', /home/michael/Local/Programming/rust/src/libsyntax/lib.rs:1

stack backtrace:
   1:     0x7f4b860cbb10 - rt::backtrace::imp::write::h6e8b78303d8814faFKq
   2:     0x7f4b860cec40 - failure::on_fail::h68e799587531299925q
   3:     0x7f4b8a4ad220 - unwind::begin_unwind_inner::haf49510935d26c3e8yd
   4:     0x7f4b8a4acd60 - unwind::begin_unwind_fmt::h1c84114572a88560Awd
   5:     0x7f4b8a4acd20 - rust_begin_unwind
   6:     0x7f4b8a504290 - failure::fail_fmt::h0337350253fe46d49ek
   7:     0x7f4b8a504130 - failure::fail_bounds_check::ha0a2903d612efc16Idk
   8:     0x7f4b86bf5ff0 - codemap::FileMap::get_line::hc7582239b93506ffqQE
   9:     0x7f4b86c2c980 - diagnostic::emit::hf89699a6e67518dbmrG
  10:     0x7f4b86c29b50 - diagnostic::EmitterWriter.Emitter::emit::h4c95b09f551649b8bnG
  11:     0x7f4b86c28340 - diagnostic::Handler::emit::h98e945dc13487948C5F
  12:     0x7f4b86bf2850 - diagnostic::SpanHandler::span_err::hf3ef21bb8eb5efe0CTF
  13:     0x7f4b8b01b5b0 - middle::typeck::infer::InferCtxt<'a, 'tcx>::type_error_message_str_with_expected::h1be9c48142591c09hpg
  14:     0x7f4b8b0b3090 - middle::typeck::infer::InferCtxt<'a, 'tcx>::type_error_message::h86e67aaa61fad7b2Avg
  15:     0x7f4b8b01fa90 - middle::typeck::check::demand::suptype::hfd893e0a5dff867eQPQ
  16:     0x7f4b8b0c2760 - middle::typeck::check::check_expr_has_type::closure.132497
  17:     0x7f4b8b0b8350 - middle::typeck::check::check_expr_with_unifier::he4306fd7f0f00e01SFX
  18:     0x7f4b8b0b8350 - middle::typeck::check::check_expr_with_unifier::he4306fd7f0f00e01SFX
  19:     0x7f4b8b10b150 - middle::typeck::check::check_stmt::h87112b0f71b1bb270MZ
  20:     0x7f4b8b0803d0 - middle::typeck::check::check_block_with_expected::h90b59d8d44bdf31cdRZ
  21:     0x7f4b8b0c3ff0 - middle::typeck::check::check_block_no_value::hcdaea54acaf4bbe38PZ
  22:     0x7f4b8b0b8350 - middle::typeck::check::check_expr_with_unifier::he4306fd7f0f00e01SFX
  23:     0x7f4b8b0803d0 - middle::typeck::check::check_block_with_expected::h90b59d8d44bdf31cdRZ
  24:     0x7f4b8b07b8a0 - middle::typeck::check::check_fn::hea46e7c687ffcb43BtU
  25:     0x7f4b8b07b5e0 - middle::typeck::check::check_bare_fn::h35548e9fbaccd943JiU
  26:     0x7f4b8b076a30 - middle::typeck::check::check_item::h39df893b3a14d5f1ACU
  27:     0x7f4b8b0798e0 - visit::walk_item::h12528687834172216328
  28:     0x7f4b8b0798e0 - visit::walk_item::h12528687834172216328
  29:     0x7f4b8b07b0b0 - middle::typeck::check::check_item_types::h0bfaa26697cac95fThU
  30:     0x7f4b8ab1b650 - util::common::time::h11267775215304567966
  31:     0x7f4b8b35d740 - middle::typeck::check_crate::h49e5ccb2edaef88a83m
  32:     0x7f4b8b3c9db0 - driver::driver::phase_3_run_analysis_passes::hddb8506836ada980rHz
  33:     0x7f4b8b3c4ef0 - driver::driver::compile_input::h646a92ac90852c70doz
  34:     0x7f4b8b450320 - driver::run_compiler::hd5c22de8b8d06a94xbD
  35:     0x7f4b8b4501d0 - driver::run::closure.145571
  36:     0x7f4b8ab354e0 - task::TaskBuilder<S>::try_future::closure.102977
  37:     0x7f4b8ab352c0 - task::TaskBuilder<S>::spawn_internal::closure.102948
  38:     0x7f4b8a8030d0 - task::spawn_opts::closure.8464
  39:     0x7f4b8a512350 - rust_try_inner
  40:     0x7f4b8a512340 - rust_try
  41:     0x7f4b8a4aaae0 - unwind::try::hd979bd38fee1e0c1Qnd
  42:     0x7f4b8a4aa960 - task::Task::run::h95374a59f92fb2f0uDc
  43:     0x7f4b8a802e10 - task::spawn_opts::closure.8404
  44:     0x7f4b8a4ac230 - thread::thread_start::h797beb6a46e8a213FXc
  45:     0x7f4b85474250 - start_thread
  46:     0x7f4b8a1853b9 - clone
  47:                0x0 - <unknown>

Seems slightly related to #14091?

Sorry I don't have a small sample to reproduce it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions