Skip to content

internal compiler error: adt::represent_type called on non-ADT type: ! #18110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Zoxc opened this issue Oct 17, 2014 · 2 comments · Fixed by #18555
Closed

internal compiler error: adt::represent_type called on non-ADT type: ! #18110

Zoxc opened this issue Oct 17, 2014 · 2 comments · Fixed by #18555
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Zoxc
Copy link
Contributor

Zoxc commented Oct 17, 2014

I get an ICE when compiling the following file: https://gist.github.com/Zoxc/072b96fe2069fff40f98#file-assembly-rs-L237 (relevant line highlighted)

assembly.rs:238:17: 238:41 warning: unreachable expression, #[warn(unreachable_code)] on by default
assembly.rs:238                 OutputIdx(outputs.len())
                                ^~~~~~~~~~~~~~~~~~~~~~~~
error: internal compiler error: adt::represent_type called on non-ADT type: !
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>', C:\bot\slave\nightly-win-64\build\src\libsyntax\diagnostic.rs:169

stack backtrace:
   1:         0x66be4ab8 - ZN2rt9backtrace3imp5write20h8b43ffd92fc3414dO9qE
   2:         0x66be851c - ZN2rt4init20h0652c1b2b1c39b6fknrE
   3:         0x668463ed - ZN6unwind18begin_unwind_inner20h179e3595a6894013OhdE
   4:         0x6a676316 - ZN10diagnostic11SpanHandler8span_bug20hcbaae1b94c636cbefLFE
   5:         0x6a676937 - ZN10diagnostic7Handler3bug20h1e12d6a2d7422fc8hRFE
   6:         0x6d6d2d11 - ZN6middle5trans3adt14represent_type20h0c0ac1f4439628cbaPtE
   7:         0x6d715919 - ZN6middle5trans4expr9trans_adt20ha9cb973b5c7ef782Xo5E
   8:         0x6d702b5b - ZN6middle2ty9expr_kind20hcc5a093c4d2d575f35GE
   9:         0x6d701589 - ZN6middle2ty9expr_kind20hcc5a093c4d2d575f35GE
  10:         0x6d6c627a - ZN6middle5trans4expr5trans20h9ad574ecb756d9efmw3E
  11:         0x6d6fa174 - ZN6middle5trans6callee10trans_args20h454130bc88a762a4i32E
  12:         0x6d6cd628 - ZN6middle5trans6callee16trans_call_inner20h3cd2486ebebf693faI2E
  13:         0x6d6f40ff - ZN6middle5trans6callee17trans_method_call20h0d54b44c2e999715DD2E
  14:         0x6d70294f - ZN6middle2ty9expr_kind20hcc5a093c4d2d575f35GE
  15:         0x6d6c4fe4 - ZN6middle5trans4expr10trans_into20he9530743b27d201bss3E
  16:         0x6d6c4380 - ZN6middle5trans11controlflow15trans_stmt_semi20h0acc3de243025e32KEZE
  17:         0x6d6c3a76 - ZN6middle5trans11controlflow10trans_stmt20h80be86ea0c9562a1xAZE
  18:         0x6d6c5229 - ZN6middle5trans11controlflow11trans_block20haceb9fae20a5e044DFZE
  19:         0x6d703091 - ZN6middle2ty9expr_kind20hcc5a093c4d2d575f35GE
  20:         0x6d6c4fe4 - ZN6middle5trans4expr10trans_into20he9530743b27d201bss3E
  21:         0x6d714d58 - ZN6middle5trans6_match11trans_match20h0c0c3a740bad7faaTLiE
  22:         0x6d70301f - ZN6middle2ty9expr_kind20hcc5a093c4d2d575f35GE
  23:         0x6d6c4fe4 - ZN6middle5trans4expr10trans_into20he9530743b27d201bss3E
  24:         0x6d705226 - ZN6middle2ty9expr_kind20hcc5a093c4d2d575f35GE
  25:         0x6d6c50e9 - ZN6middle5trans4expr10trans_into20he9530743b27d201bss3E
  26:         0x6d6c5318 - ZN6middle5trans11controlflow11trans_block20haceb9fae20a5e044DFZE
  27:         0x6d6c9e02 - ZN6middle5trans11controlflow9trans_for20hae3cc94d5cd2b3202RZE
  28:         0x6d704d4d - ZN6middle2ty9expr_kind20hcc5a093c4d2d575f35GE
  29:         0x6d6c50e9 - ZN6middle5trans4expr10trans_into20he9530743b27d201bss3E
  30:         0x6d6c4380 - ZN6middle5trans11controlflow15trans_stmt_semi20h0acc3de243025e32KEZE
  31:         0x6d6c3a76 - ZN6middle5trans11controlflow10trans_stmt20h80be86ea0c9562a1xAZE
  32:         0x6d6c5229 - ZN6middle5trans11controlflow11trans_block20haceb9fae20a5e044DFZE
  33:         0x6d76fc40 - ZN6middle5trans4base13trans_closure20h89f07cf629bedf2coBfE
  34:         0x6d6b741d - ZN6middle5trans4base8trans_fn20h21be404295af088bMMfE
  35:         0x6d6b4b41 - ZN6middle5trans4base10trans_item20hb6929d95cf58e43155fE
  36:         0x6d7795a9 - ZN6middle5trans4base11trans_crate20h4da3d643db54970aB4gE
  37:         0x6dbbe8b9 - ZN6driver6driver25phase_4_translate_to_llvm20h69214abe29522897NDxE
  38:         0x6dbb61f3 - ZN6driver6driver13compile_input20hd3784fefcc633941IaxE
  39:         0x6dc3c7b1 - ZN6driver7monitor20h8da1b58086cb64cfoNBE
  40:         0x6dc3aad0 - ZN6driver7monitor20h8da1b58086cb64cfoNBE
  41:         0x6d33dbb5 - ZN6driver6driver35OutputFilenames...std..clone..Clone5clone20hdba80f9a75c89415a0xE
  42:         0x6d33dae7 - ZN6driver6driver35OutputFilenames...std..clone..Clone5clone20hdba80f9a75c89415a0xE
  43:         0x7072a50c - ZN4task10spawn_opts20h7e5f7c9c3d25d48aJteE
  44:         0x668ab64f - rust_try
  45:         0x668ab629 - rust_try
  46:         0x6684439e - ZN6unwind3try20h1c20c11879bf01d2S4cE
  47:         0x668441d9 - ZN4task4Task3run20he4d7a274f6588b36izcE
  48:         0x7072a346 - ZN4task10spawn_opts20h7e5f7c9c3d25d48aJteE
  49:         0x668459b7 - ZN4task11BlockedTask14cast_from_uint20hae3c8f07961c6d9eVRcE
  50:     0x7ffbe8e616ad - BaseThreadInitThunk
@huonw huonw added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 17, 2014
@arielb1
Copy link
Contributor

arielb1 commented Oct 19, 2014

Minimized:

pub fn expand() {
    ({loop {}},)
}

Backtrace:

rror: internal compiler error: adt::represent_type called on non-ADT type: !
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:175

stack backtrace:
   1:     0x7f4ffcb17bf0 - rt::backtrace::imp::write::h37a3af22082b7094FKq
   2:     0x7f4ffcb1ad20 - failure::on_fail::hf01d9f1e1bdb6e5425q
   3:     0x7f5001083b30 - unwind::begin_unwind_inner::h2ec64a9d433f6b868yd
   4:     0x7f4ffd890610 - unwind::begin_unwind::h11468189666407495110
   5:     0x7f4ffd890dc0 - diagnostic::Handler::bug::h10aa9d98e5527d0113F
   6:     0x7f5001a99cf0 - middle::trans::adt::represent_type::hf0465ce97f58ee09Kqu
   7:     0x7f5001ade0b0 - middle::trans::expr::trans_adt::h26ddc6e798cc0d53Hr6
   8:     0x7f5001acaa20 - middle::trans::expr::trans_rvalue_dps_unadjusted::h59ca517824b4c63aET5
   9:     0x7f5001a8e380 - middle::trans::expr::trans_into::hc8db703a1280c662cv4
  10:     0x7f5001a8e7a0 - middle::trans::controlflow::trans_block::h26f0fa752a438c4fDL0
  11:     0x7f5001b361d0 - middle::trans::base::trans_closure::haec1e74530eb7cefQIg
  12:     0x7f5001a80da0 - middle::trans::base::trans_fn::h778cc3315cb016b0eUg
  13:     0x7f5001a7e400 - middle::trans::base::trans_item::h8e6f687fd31b992bxdh
  14:     0x7f5001b41030 - middle::trans::base::trans_crate::h1e2bed8778c95c8dkbi
  15:     0x7f5001f9a3b0 - driver::driver::phase_4_translate_to_llvm::hbdeb13ca358e159eD9z
  16:     0x7f5001f91450 - driver::driver::compile_input::h8a818e073bdb900cyGz
  17:     0x7f500201c950 - driver::run_compiler::h7e400358677f3066StD
  18:     0x7f500201c800 - driver::run::closure.145782
  19:     0x7f5001701b70 - task::TaskBuilder<S>::try_future::closure.103164
  20:     0x7f5001701950 - task::TaskBuilder<S>::spawn_internal::closure.103135
  21:     0x7f50013cea30 - task::spawn_opts::closure.8464
  22:     0x7f50010ddaa0 - rust_try_inner
  23:     0x7f50010dda90 - rust_try
  24:     0x7f50010813f0 - unwind::try::h0bc5cc5739b8d3c3Qnd
  25:     0x7f5001081270 - task::Task::run::h517e4360aedfbf45uDc
  26:     0x7f50013ce770 - task::spawn_opts::closure.8404
  27:     0x7f5001082b40 - thread::thread_start::h43c1915a7e23212cFXc
  28:     0x7f4ffbec3fe0 - start_thread
  29:     0x7f5000d53bf9 - __clone
  30:                0x0 - <unknown>

@arielb1
Copy link
Contributor

arielb1 commented Oct 19, 2014

It seems like replacing ty_bot with <Unsized? T> T would fix this. cc #18110

@ghost ghost added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Oct 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants