Skip to content

rustc-beta.5 ICE while printing error #25353

Closed
@maurer

Description

@maurer

My code has a type error, that's on me, but rustc ICEs while trying to report the error.
This occurs on rustc-beta.5 but not on current Nightly. (Current nightly prints internal compiler error: unprintable span but does not crash, generate a backtrace with RUST_BACKTRACE=1, or exhort me to report the bug.)

Code in question is unmimized, but the input is available here.

maurer@fragarach ~/Sources/holmes $ RUST_BACKTRACE=1 cargo test
   Compiling holmes v0.0.1 (file:///home/maurer/Sources/holmes)
tests/predicate_basic.rs:26:5: 2:42 error: mismatched types:
 expected `()`,
    found `collections::string::String`
(expected (),
    found struct `collections::string::String`) [E0308]
error: internal compiler error: unexpected panic
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 'capacity overflow', /home/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-linux/build/src/libcore/option.rs:330

stack backtrace:
   1:     0x7ff852524429 - sys::backtrace::write::h3fdf06e7a8dd7bced4r
   2:     0x7ff85252c136 - panicking::on_panic::hdc3f6d7788894b93jrw
   3:     0x7ff8524ef442 - rt::unwind::begin_unwind_inner::h93ec8cb6029f2822t6v
   4:     0x7ff8524f00ec - rt::unwind::begin_unwind_fmt::h0b4dd831ba99497b74v
   5:     0x7ff85252bd16 - rust_begin_unwind
   6:     0x7ff852578044 - panicking::panic_fmt::h2602585117d51b40wwy
   7:     0x7ff84faa56bf - codemap::CodeMap::span_to_lines::hcb96211657be04b8oiA
   8:     0x7ff84faea607 - diagnostic::emit::h44f1e44ee2adfa9amTB
   9:     0x7ff84fae8454 - diagnostic::EmitterWriter.Emitter::emit::h98c9b52f3bc967504PB
  10:     0x7ff84fae69ab - diagnostic::SpanHandler::span_err_with_code::he869bc155fe9aef6EmB
  11:     0x7ff850382615 - session::Session::span_err_with_code::h9d4c90114cb92befRxq
  12:     0x7ff85057eb19 - middle::infer::error_reporting::InferCtxt<'a, 'tcx>.ErrorReporting<'tcx>::report_type_error::haf794be6c351ab63BRq
  13:     0x7ff850580386 - middle::infer::error_reporting::InferCtxt<'a, 'tcx>.ErrorReporting<'tcx>::report_and_explain_type_error::hedd5208780511c68pTq
  14:     0x7ff8505d8713 - middle::infer::InferCtxt<'a, 'tcx>::report_mismatched_types::hedabf97f021a46449Lz
  15:     0x7ff85133b9b6 - check::demand::coerce::h3c96cf4e187ed1117Hf
  16:     0x7ff8513d349b - check::check_expr_with_unifier::h15794470645070384888
  17:     0x7ff8513a3eec - check::check_block_with_expected::ha385fa00451511c6nUr
  18:     0x7ff8513d3dd8 - check::check_expr_with_unifier::h15794470645070384888
  19:     0x7ff8513a3eec - check::check_block_with_expected::ha385fa00451511c6nUr
  20:     0x7ff8513d3dd8 - check::check_expr_with_unifier::h15794470645070384888
  21:     0x7ff8513a3eec - check::check_block_with_expected::ha385fa00451511c6nUr
  22:     0x7ff8513866d6 - check::check_fn::hbbb50115804bad19UGn
  23:     0x7ff851384c9a - check::closure::check_expr_closure::hd87ca7843a3b19dacsl
  24:     0x7ff8513e57f2 - check::check_expr_with_unifier::h8479634674413911501
  25:     0x7ff8513b2a19 - check::check_expr_with_unifier::h13654519978556571655
  26:     0x7ff85138cb28 - check::check_argument_types::h7a36728b112e36dd6Hp
  27:     0x7ff85138a02b - check::callee::confirm_builtin_call::h98a381787eb801b482l
  28:     0x7ff8513888c1 - check::callee::check_call::hfe6fb95caee17a4bQTl
  29:     0x7ff8513d377b - check::check_expr_with_unifier::h15794470645070384888
  30:     0x7ff8513a3eec - check::check_block_with_expected::ha385fa00451511c6nUr
  31:     0x7ff8513866d6 - check::check_fn::hbbb50115804bad19UGn
  32:     0x7ff85139f5a4 - check::check_bare_fn::he66bf0548da8b8d1twn
  33:     0x7ff85139d702 - check::CheckItemBodiesVisitor<'a, 'tcx>.Visitor<'tcx>::visit_item::h5534b4c58b22cf23wtn
  34:     0x7ff85139d8ef - check::CheckItemBodiesVisitor<'a, 'tcx>.Visitor<'tcx>::visit_item::h5534b4c58b22cf23wtn
  35:     0x7ff8514616aa - check_crate::closure.38021
  36:     0x7ff85145ca40 - check_crate::h44f7d6f01042e613XcC
  37:     0x7ff852a67c88 - driver::phase_3_run_analysis_passes::h071f1f038f4270canGa
  38:     0x7ff852a48d85 - driver::compile_input::hc5c2173550d25b21Qba
  39:     0x7ff852b0a551 - run_compiler::h5fd7a3cba8c0dcd3z4b
  40:     0x7ff852b081a2 - boxed::F.FnBox<A>::call_box::h13268679164253669965
  41:     0x7ff852b076d9 - rt::unwind::try::try_fn::h1333595601538020842
  42:     0x7ff85259eaa8 - rust_try_inner
  43:     0x7ff85259ea95 - rust_try
  44:     0x7ff852b07988 - boxed::F.FnBox<A>::call_box::h18060233810932446010
  45:     0x7ff85252b021 - sys::thread::create::thread_start::h7002e49f5ed4f198aqv
  46:     0x7ff84cddd203 - <unknown>
  47:     0x7ff85218f5bc - clone
  48:                0x0 - <unknown>

Build failed, waiting for other jobs to finish...
Could not compile `holmes`.

To learn more, run the command again with --verbose.
maurer@fragarach ~/Sources/holmes $ 

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