Skip to content

error: internal compiler error: adt::represent_type called on non-ADT type: &std ::io::IoError #20046

Closed
@evmar

Description

   Compiling sha1sum v0.0.1 (file:///home/evanm/projects/rust/sha1sum)
error: internal compiler error: adt::represent_type called on non-ADT type: &std::io::IoError
note: the compiler unexpectedly panicked. 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' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/diagnostic.rs:188

stack backtrace:
   1:     0x7f5eb2c9af10 - rt::backtrace::imp::write::h28b8bbd9f503cf471Xx
   2:     0x7f5eb2c9e570 - failure::on_fail::hd0a2ddc03e0fa8a6opy
   3:     0x7f5eb28de6a0 - unwind::begin_unwind_inner::hedcb21b2885493daaNc
   4:     0x7f5eaff927e0 - unwind::begin_unwind::h14053085834319754591
   5:     0x7f5eaff93090 - diagnostic::Handler::bug::h88688dedb903e5ddeRF
   6:     0x7f5eb0ce1250 - session::Session::bug::hc1287fe1a705e6adSLu
   7:     0x7f5eb18261f0 - trans::adt::represent_type_uncached::he6675fb263092d5deMH
   8:     0x7f5eb1710530 - trans::adt::represent_type::hd46d360c5fae4210nIH
   9:     0x7f5eb17c2fc0 - trans::_match::compile_submatch_continue::hba348eef0dad30a0a2w
  10:     0x7f5eb17c0ab0 - trans::_match::compile_submatch::h908579cfdcf3da5fxWw
  11:     0x7f5eb17c2fc0 - trans::_match::compile_submatch_continue::hba348eef0dad30a0a2w
  12:     0x7f5eb17c0ab0 - trans::_match::compile_submatch::h908579cfdcf3da5fxWw
  13:     0x7f5eb17c7b10 - trans::_match::trans_match_inner::h4dfb82c4024d7437svx
  14:     0x7f5eb173b930 - trans::expr::trans_rvalue_dps_unadjusted::h1c34ba6d0fbc42abX8i
  15:     0x7f5eb16f7500 - trans::expr::trans_into::hea40bf13dbc784e8sFh
  16:     0x7f5eb16f6910 - trans::controlflow::trans_stmt_semi::h5ed64e36e117a6c8PYd
  17:     0x7f5eb16f7c60 - trans::controlflow::trans_block::h61d649e79c6d3e91IZd
  18:     0x7f5eb17408e0 - trans::expr::trans_rvalue_stmt_unadjusted::hdd4f67405c596af0e3i
  19:     0x7f5eb16f7500 - trans::expr::trans_into::hea40bf13dbc784e8sFh
  20:     0x7f5eb16f7c60 - trans::controlflow::trans_block::h61d649e79c6d3e91IZd
  21:     0x7f5eb17a6660 - trans::base::trans_closure::h4a257820d48920f5P8t
  22:     0x7f5eb16ec1d0 - trans::base::trans_fn::he64630405a744a1c6ju
  23:     0x7f5eb16e7850 - trans::base::trans_item::hedeca6906d42d5ef8Eu
  24:     0x7f5eb17ae5d0 - trans::base::trans_crate::h409f313f53dd00d1jBv
  25:     0x7f5eb30ff090 - driver::phase_4_translate_to_llvm::ha3e95ae8dd99774cXCa
  26:     0x7f5eb30d5ee0 - driver::compile_input::h3c93a433de329ec1rba
  27:     0x7f5eb328a020 - run_compiler::h6520470d7d92765aAYb
  28:     0x7f5eb3280c60 - thunk::F.Invoke<A,$u{20}R$GT$::invoke::h1449879172494822488
  29:     0x7f5eb2c732c0 - thunk::F.Invoke<A,$u{20}R$GT$::invoke::h14525951389403266713
  30:     0x7f5eb28dce10 - task::Task::spawn_thunk::closure.5804
  31:     0x7f5eb293b9b0 - rust_try_inner
  32:     0x7f5eb293b9a0 - rust_try
  33:     0x7f5eb28dcf20 - unwind::try::h870bc6c90527a031rCc
  34:     0x7f5eb28dccb0 - task::Task::run::h3063eac886af1b39tNb
  35:     0x7f5eb28dc420 - thunk::F.Invoke<A,$u{20}R$GT$::invoke::h6184366571468466973
  36:     0x7f5eb28ddd70 - thread::thread_start::h6cf2d96de299983bM4b
  37:     0x7f5ead3f30c0 - start_thread
  38:     0x7f5eb25a0ec9 - __clone
  39:                0x0 - <unknown>

Could not compile `sha1sum`.

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

Reduced code, with the line causing the ICE marked in a comment:

use std::io;

fn main() {
    let mut stdinx = io::stdio::stdin();
    let mut stdin = stdinx.lock();
    loop {
        match stdin.fill_buf() {
            Ok(_) => true,
            Err(ref e) if e.kind == io::EndOfFile => break,
            // *** I added the following line, seeing whether I could pattern
            // match instead of use a guard, and that produced the error.
            Err(io::IoError { kind: io::EndOfFile, ..}) => break,
            Err(err) => panic!(err)
        };
    }
}

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