Skip to content

Unexpected panic when compiling ill-formed code #22712

Closed
@LukasKalbertodt

Description

@LukasKalbertodt

When compiling ill formed code the rust compiler panics, printing: "error: internal compiler error: ident only path should have been covered already".
I saw a few issues with the same error message ( #22665 , #22426 , #22589 ) but to me they seem to be different bugs...

I tried this code:

use std::vec::Vec;

struct Foo<B> {
    buffer: B
}

fn bar() {
  let Foo<Vec<u8>>
}

I expected to see this happen: A nice compiler error message.

Instead, this happened: Internal compiler error.

Meta

rustc --version --verbose:

rustc 1.0.0-nightly (2b01a37ec 2015-02-21) (built 2015-02-22)
binary: rustc
commit-hash: 2b01a37ec38db9301239f0c0abcf3c695055b0ff
commit-date: 2015-02-21
build-date: 2015-02-22
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly

Backtrace:

$ RUST_BACKTRACE=1 rustc lib.rs 

lib.rs:8:7: 8:10 error: internal compiler error: ident only path should have been covered already
lib.rs:8   let Foo<Vec<u8>>
               ^~~
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:129

stack backtrace:
   1:     0x7f8ea8678210 - sys::backtrace::write::h58f3688f47ea9825KlC
   2:     0x7f8ea86a0ac0 - panicking::on_panic::h6a53d3220988f2eebYL
   3:     0x7f8ea85e1720 - rt::unwind::begin_unwind_inner::h72a0c6e103bfcdc3zCL
   4:     0x7f8ea58abde0 - rt::unwind::begin_unwind::h2955836616559227712
   5:     0x7f8ea58abd70 - diagnostic::SpanHandler::span_bug::h3f1d138a57b9309dqZE
   6:     0x7f8ea58ce780 - parse::parser::Parser<'a>::parse_pat::h809bd931d91273bfrML
   7:     0x7f8ea58e4840 - parse::parser::Parser<'a>::parse_local::h2e00e7b160166912v2L
   8:     0x7f8ea58e4a60 - parse::parser::Parser<'a>::parse_stmt::h0653bed7d257c65eq5L
   9:     0x7f8ea58ee410 - parse::parser::Parser<'a>::parse_block_tail_::h3c43c34d39ff87a5TgM
  10:     0x7f8ea58ccb70 - parse::parser::Parser<'a>::parse_inner_attrs_and_block::hebb7a527b0f1d8c5dfM
  11:     0x7f8ea58f2a50 - parse::parser::Parser<'a>::parse_item_fn::hc7a9a7383a82e7a4aWM
  12:     0x7f8ea58e76e0 - parse::parser::Parser<'a>::parse_item_::h9be2ca1f12dcd0aeuVN
  13:     0x7f8ea58f8c50 - parse::parser::Parser<'a>::parse_mod_items::hb94387fccea63b29KkN
  14:     0x7f8ea59041a0 - parse::parser::Parser<'a>::parse_crate_mod::h961b7044a0ca58e2AmO
  15:     0x7f8ea5917060 - parse::parse_crate_from_file::h8fb07d2676fac76cqOV
  16:     0x7f8ea8d025a0 - driver::phase_1_parse_input::closure.16948
  17:     0x7f8ea8cdc8d0 - driver::phase_1_parse_input::h49108518c50c4641Qra
  18:     0x7f8ea8cd92d0 - driver::compile_input::hfb1bb38c59866d0fGba
  19:     0x7f8ea8da8510 - run_compiler::hf2a7d9848e51e3b5Zbc
  20:     0x7f8ea8da6e10 - thunk::F.Invoke<A, R>::invoke::h12698859262113329290
  21:     0x7f8ea8da5d00 - rt::unwind::try::try_fn::h10854600533917764358
  22:     0x7f8ea870d880 - rust_try_inner
  23:     0x7f8ea870d870 - rust_try
  24:     0x7f8ea8da6000 - thunk::F.Invoke<A, R>::invoke::h4174228679526982116
  25:     0x7f8ea868cb60 - sys::thread::thread_start::h60ae7cb39d135ef7R4G
  26:     0x7f8ea256a0c0 - start_thread
  27:     0x7f8ea8259fd9 - __clone
  28:                0x0 - <unknown>

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