Skip to content
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

ICE: index out of bounds: the len is 0 but the index is 0' with --emit mir and mir-opt-level >1 #72181

Closed
matthiaskrgr opened this issue May 13, 2020 · 6 comments · Fixed by #73442
Labels
A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. F-never_type `#![feature(never_type)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

This miri test code ./src/tools/miri/tests/compile-fail/never_transmute_void.rs

// This should fail even without validation
// compile-flags: -Zmiri-disable-validation

#![feature(never_type)]
#![allow(unused, invalid_value)]

enum Void {}

fn f(v: Void) -> ! {
    match v {} //~ ERROR entering unreachable code
}

fn main() {
    let v: Void = unsafe {
        std::mem::transmute::<(), Void>(())
    };
    f(v); //~ inside `main`
}

Causes an ice when compiled with -Zmir-opt-level=2 --emit mir (but not with opt-level <2 or missing --emit mir)

Meta

rustc --version --verbose:

rustc 1.45.0-nightly (769d12eec 2020-05-12)
binary: rustc
commit-hash: 769d12eec1d0bc3708841dfc149d3ec98b04bec6
commit-date: 2020-05-12
host: x86_64-unknown-linux-gnu
release: 1.45.0-nightly
LLVM version: 9.0

Error output

thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', src/librustc_middle/ty/mod.rs:2455:19
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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: rustc 1.45.0-nightly (769d12eec 2020-05-12) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z mir-opt-level=2

Backtrace

thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', src/librustc_middle/ty/mod.rs:2455:19
stack backtrace:
   0:     0x7f232747aa64 - backtrace::backtrace::libunwind::trace::h98d3444f0ad70429
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1:     0x7f232747aa64 - backtrace::backtrace::trace_unsynchronized::h371770250c47e40d
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2:     0x7f232747aa64 - std::sys_common::backtrace::_print_fmt::hff04dc7e915a3c85
                               at src/libstd/sys_common/backtrace.rs:78
   3:     0x7f232747aa64 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h61891c439a79f00d
                               at src/libstd/sys_common/backtrace.rs:59
   4:     0x7f23274b896c - core::fmt::write::hdf236390fbd68d3d
                               at src/libcore/fmt/mod.rs:1069
   5:     0x7f232746c433 - std::io::Write::write_fmt::h1a1f8616ed2f90f9
                               at src/libstd/io/mod.rs:1537
   6:     0x7f232747fa85 - std::sys_common::backtrace::_print::h78339381acb79e1b
                               at src/libstd/sys_common/backtrace.rs:62
   7:     0x7f232747fa85 - std::sys_common::backtrace::print::h525aa9f9405c80a1
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x7f232747fa85 - std::panicking::default_hook::{{closure}}::hace90b8a218287e6
                               at src/libstd/panicking.rs:198
   9:     0x7f232747f7d7 - std::panicking::default_hook::h160b6beccc49b335
                               at src/libstd/panicking.rs:218
  10:     0x7f2327a99c23 - rustc_driver::report_ice::h4f38da7fac8ebd4c
  11:     0x7f232748013d - std::panicking::rust_panic_with_hook::h36f6804eea3f553a
                               at src/libstd/panicking.rs:481
  12:     0x7f232747fd1b - rust_begin_unwind
                               at src/libstd/panicking.rs:385
  13:     0x7f23274b5601 - core::panicking::panic_fmt::hd101a87121fa411f
                               at src/libcore/panicking.rs:89
  14:     0x7f23274b55c2 - core::panicking::panic_bounds_check::ha0668dcff6357ef4
                               at src/libcore/panicking.rs:65
  15:     0x7f232a2858b8 - rustc_middle::ty::AdtDef::discriminant_def_for_variant::hb8665f68c3c8925f
  16:     0x7f23290981a4 - rustc_middle::ty::sty::<impl rustc_middle::ty::TyS>::discriminant_for_variant::hf8f2b2d0f600757c
  17:     0x7f23290dcc63 - rustc_mir::interpret::operand::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::read_discriminant::h04383a786f9e5f5c
  18:     0x7f2328e8ed6b - rustc_mir::const_eval::destructure_const::hea137a6a8b6323b8
  19:     0x7f2328debda4 - core::ops::function::FnOnce::call_once::he49d534148327124
  20:     0x7f2329fb2fb1 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::destructure_const>::compute::hfa7b6d2252302ba6
  21:     0x7f232a060885 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hb3d4c13d744e715a
  22:     0x7f232a3ab702 - rustc_data_structures::stack::ensure_sufficient_stack::hdcee244c83eb407b
  23:     0x7f232a1763a4 - rustc_query_system::query::plumbing::get_query_impl::hef1678ca65220230
  24:     0x7f2329fa1302 - rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_const::h583cec005ac559c3
  25:     0x7f232a0a999f - rustc_middle::mir::pretty_print_const::ha73776b5fc4e1f49
  26:     0x7f23274b896c - core::fmt::write::hdf236390fbd68d3d
                               at src/libcore/fmt/mod.rs:1069
  27:     0x7f23274b9794 - core::fmt::Formatter::write_fmt::h95caeeba181649fe
                               at src/libcore/fmt/mod.rs:1498
  28:     0x7f232a3c2d74 - <&T as core::fmt::Debug>::fmt::hc537246aca244980
  29:     0x7f23274b896c - core::fmt::write::hdf236390fbd68d3d
                               at src/libcore/fmt/mod.rs:1069
  30:     0x7f23274b9794 - core::fmt::Formatter::write_fmt::h95caeeba181649fe
                               at src/libcore/fmt/mod.rs:1498
  31:     0x7f232a0a6f58 - <rustc_middle::mir::Operand as core::fmt::Debug>::fmt::h666dba9a1334652c
  32:     0x7f23274b896c - core::fmt::write::hdf236390fbd68d3d
                               at src/libcore/fmt/mod.rs:1069
  33:     0x7f23274b9794 - core::fmt::Formatter::write_fmt::h95caeeba181649fe
                               at src/libcore/fmt/mod.rs:1498
  34:     0x7f232a0a56b2 - <rustc_middle::mir::TerminatorKind as core::fmt::Debug>::fmt::h3ca5eba4a9e4e295
  35:     0x7f23274b88db - core::fmt::run::h9b3b3bec27be60ec
                               at src/libcore/fmt/mod.rs:1103
  36:     0x7f23274b88db - core::fmt::write::hdf236390fbd68d3d
                               at src/libcore/fmt/mod.rs:1078
  37:     0x7f23274ab812 - core::fmt::Write::write_fmt::h0a4283ca6cdb8567
                               at /rustc/769d12eec1d0bc3708841dfc149d3ec98b04bec6/src/libcore/fmt/mod.rs:193
  38:     0x7f23274ab812 - alloc::fmt::format::h657722b395b07d36
                               at src/liballoc/fmt.rs:586
  39:     0x7f2328f26e46 - rustc_mir::util::pretty::write_mir_pretty::h5f0518bd9dc7a33c
  40:     0x7f232916ad2f - rustc_mir::transform::dump_mir::emit_mir::h3ac1a091dc0e3c6e
  41:     0x7f2327e4fead - rustc_interface::passes::start_codegen::h459335c6dd01052b
  42:     0x7f2327d37b29 - rustc_middle::ty::context::tls::enter_global::h739103a57ae08ef8
  43:     0x7f2327d52806 - rustc_interface::queries::Queries::ongoing_codegen::hfa82dc9d28eff2f3
  44:     0x7f2327a680ff - rustc_interface::interface::run_compiler_in_existing_thread_pool::h9607844d06857db5
  45:     0x7f2327aa77bd - scoped_tls::ScopedKey<T>::set::haf4c7963bcdf05e7
  46:     0x7f2327aa04a4 - rustc_ast::attr::with_globals::h6a7f645f85d913be
  47:     0x7f2327aa8abe - std::sys_common::backtrace::__rust_begin_short_backtrace::hc1d7bb4af8e37486
  48:     0x7f2327bf666e - core::ops::function::FnOnce::call_once{{vtable.shim}}::h274c438c26ba3928
  49:     0x7f23274900aa - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h5b84f52b19042f22
                               at /rustc/769d12eec1d0bc3708841dfc149d3ec98b04bec6/src/liballoc/boxed.rs:1034
  50:     0x7f23274900aa - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h6e1ef057e35f3144
                               at /rustc/769d12eec1d0bc3708841dfc149d3ec98b04bec6/src/liballoc/boxed.rs:1034
  51:     0x7f23274900aa - std::sys::unix::thread::Thread::new::thread_start::h8b0ae441dc3343d4
                               at src/libstd/sys/unix/thread.rs:87
  52:     0x7f23273a446f - start_thread
  53:     0x7f23272c43d3 - clone
  54:                0x0 - <unknown>

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: rustc 1.45.0-nightly (769d12eec 2020-05-12) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z mir-opt-level=2

query stack during panic:
#0 [destructure_const] destructure constant
end of query stack

@matthiaskrgr matthiaskrgr added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 13, 2020
@jonas-schievink jonas-schievink added A-mir-opt Area: MIR optimizations requires-nightly This issue requires a nightly compiler in some way. labels May 13, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label May 18, 2020
@JohnTitor JohnTitor added the F-never_type `#![feature(never_type)]` label May 20, 2020
@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Jun 5, 2020

Looks like this also happens in ./src/test/ui/issues/issue-46855.rs which does not use any special features

// run-pass
#![allow(dead_code)]
// compile-flags: -Zmir-opt-level=1

use std::mem;

#[derive(Copy, Clone)]
enum Never {}

union Foo {
    a: u64,
    b: Never
}

fn foo(xs: [(Never, u32); 1]) -> u32 { xs[0].1 }

fn bar([(_, x)]: [(Never, u32); 1]) -> u32 { x }

fn main() {
    println!("{}", mem::size_of::<Foo>());

    let f = [Foo { a: 42 }, Foo { a: 10 }];
    println!("{:?}", unsafe { f[0].a });
}

cmd: RUST_BACKTRACE=full build/x86_64-unknown-linux-gnu/stage2/bin/rustc ./src/test/ui/issues/issue-46855.rs -Zmir-opt-level=1 --emit mir

EDIT: backtrace:

thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', src/librustc_middle/ty/mod.rs:2359:19
stack backtrace:
   0:     0x7f2188294d57 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he2fbf5405bd3f46a
   1:     0x7f21882e1a3d - core::fmt::write::h65255e7874586eb2
   2:     0x7f2188265b95 - std::io::Write::write_fmt::h3c49d63e356d89fe
   3:     0x7f2188271980 - std::panicking::default_hook::{{closure}}::h6b88f05100c9e449
   4:     0x7f2188271694 - std::panicking::default_hook::h57a663a807afe943
   5:     0x7f2189c298a3 - rustc_driver::report_ice::h34c4499908ba0b29
   6:     0x7f218827206c - std::panicking::rust_panic_with_hook::haef04471b94d420c
   7:     0x7f2188271c3b - rust_begin_unwind
   8:     0x7f21882df7e1 - core::panicking::panic_fmt::h95ae6ee01add471a
   9:     0x7f21882df7a2 - core::panicking::panic_bounds_check::h50981b2f442979f1
  10:     0x7f218d9f15c8 - rustc_middle::ty::AdtDef::discriminant_def_for_variant::hb5d4a4e0979d34e0
  11:     0x7f218c6ca1e2 - rustc_middle::ty::sty::<impl rustc_middle::ty::TyS>::discriminant_for_variant::he55d7c41489848d7
  12:     0x7f218c7160c7 - rustc_mir::interpret::operand::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::read_discriminant::h5f5c38f26e8b8ed8
  13:     0x7f218c79dbdd - rustc_mir::const_eval::destructure_const::h1f2cd6036022dfb8
  14:     0x7f218c32db46 - core::ops::function::FnOnce::call_once::h8c20fbb5bf3c1dd6
  15:     0x7f218d68c8ad - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::destructure_const>::compute::h3615046505938230
  16:     0x7f218d71cb09 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::ha13979abed354d04
  17:     0x7f218d88a1b6 - rustc_data_structures::stack::ensure_sufficient_stack::hb28e752bbf70f332
  18:     0x7f218d76be7a - rustc_query_system::query::plumbing::get_query_impl::h4795959616542474
  19:     0x7f218d663492 - rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_const::h42bd810d2dabec53
  20:     0x7f218d663db3 - rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_const::h42bd810d2dabec53
  21:     0x7f218d65472c - rustc_middle::mir::pretty_print_const::hd7cbc3a530cb0234
  22:     0x7f21882e1a3d - core::fmt::write::h65255e7874586eb2
  23:     0x7f21882e2db2 - <core::fmt::Formatter as core::fmt::Write>::write_fmt::h2cfc8f96fe0dc0bb
  24:     0x7f218d89f974 - <&T as core::fmt::Debug>::fmt::h61826e44f28f4f4a
  25:     0x7f21882e1a3d - core::fmt::write::h65255e7874586eb2
  26:     0x7f21882e2db2 - <core::fmt::Formatter as core::fmt::Write>::write_fmt::h2cfc8f96fe0dc0bb
  27:     0x7f218d651aa5 - <rustc_middle::mir::Operand as core::fmt::Debug>::fmt::hf2307fe080426e27
  28:     0x7f21882e1a3d - core::fmt::write::h65255e7874586eb2
  29:     0x7f21882e2db2 - <core::fmt::Formatter as core::fmt::Write>::write_fmt::h2cfc8f96fe0dc0bb
  30:     0x7f218d65223c - <rustc_middle::mir::Rvalue as core::fmt::Debug>::fmt::hd0f3169c5295fd5a
  31:     0x7f21882e1a3d - core::fmt::write::h65255e7874586eb2
  32:     0x7f21882e2db2 - <core::fmt::Formatter as core::fmt::Write>::write_fmt::h2cfc8f96fe0dc0bb
  33:     0x7f218d6513a8 - <rustc_middle::mir::Statement as core::fmt::Debug>::fmt::hc9cc86a23e746649
  34:     0x7f21882e19aa - core::fmt::write::h65255e7874586eb2
  35:     0x7f21882bf6ca - alloc::fmt::format::hc8afcfd973bb1a1f
  36:     0x7f218c366f71 - rustc_mir::util::pretty::write_mir_pretty::h93c9145185ddab0f
  37:     0x7f218c862c23 - rustc_mir::transform::dump_mir::emit_mir::h514eb69ae7eaa045
  38:     0x7f2189de7604 - rustc_interface::passes::start_codegen::h64d9c511ec596bff
  39:     0x7f2189e156d2 - rustc_middle::ty::context::tls::enter_global::hd5d9719ecc10b8ad
  40:     0x7f2189e0b77e - rustc_interface::queries::Queries::ongoing_codegen::h5a481c30c4739353
  41:     0x7f2189c37a0b - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h46a369817e38d2d4
  42:     0x7f2189ca17ca - rustc_span::with_source_map::ha1e1d15982d868c1
  43:     0x7f2189c39b49 - rustc_interface::interface::run_compiler_in_existing_thread_pool::hfd5622ef3ce026be
  44:     0x7f2189c1334e - scoped_tls::ScopedKey<T>::set::hd3c1397285b10bd3
  45:     0x7f2189c3a576 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3df4554cf04b61c9
  46:     0x7f2189c0717e - core::ops::function::FnOnce::call_once{{vtable.shim}}::hb0a109416f61afc2
  47:     0x7f2188279d7a - std::sys::unix::thread::Thread::new::thread_start::hb2effada6f868308
  48:     0x7f2187fa0422 - start_thread
  49:     0x7f21880bebf3 - __GI___clone
  50:                0x0 - <unknown>

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: rustc 1.45.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z mir-opt-level=1

query stack during panic:
#0 [destructure_const] destructure constant
end of query stack

@RalfJung
Copy link
Member

RalfJung commented Jun 5, 2020

Is this a regression? Looks like the backtrace points to read_discriminant which was recently changed in #72419.

@RalfJung
Copy link
Member

RalfJung commented Jun 5, 2020

Ah, but the original report is from before that PR. Not a regression then, or at least not caused by this PR.

@RalfJung
Copy link
Member

RalfJung commented Jun 5, 2020

@matthiaskrgr could you post a backtrace for the second ICE? The first one was related to the match, but the second does not have a match.

@matthiaskrgr
Copy link
Member Author

backtrace:

thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', src/librustc_middle/ty/mod.rs:2359:19
stack backtrace:
   0:     0x7f2188294d57 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he2fbf5405bd3f46a
   1:     0x7f21882e1a3d - core::fmt::write::h65255e7874586eb2
   2:     0x7f2188265b95 - std::io::Write::write_fmt::h3c49d63e356d89fe
   3:     0x7f2188271980 - std::panicking::default_hook::{{closure}}::h6b88f05100c9e449
   4:     0x7f2188271694 - std::panicking::default_hook::h57a663a807afe943
   5:     0x7f2189c298a3 - rustc_driver::report_ice::h34c4499908ba0b29
   6:     0x7f218827206c - std::panicking::rust_panic_with_hook::haef04471b94d420c
   7:     0x7f2188271c3b - rust_begin_unwind
   8:     0x7f21882df7e1 - core::panicking::panic_fmt::h95ae6ee01add471a
   9:     0x7f21882df7a2 - core::panicking::panic_bounds_check::h50981b2f442979f1
  10:     0x7f218d9f15c8 - rustc_middle::ty::AdtDef::discriminant_def_for_variant::hb5d4a4e0979d34e0
  11:     0x7f218c6ca1e2 - rustc_middle::ty::sty::<impl rustc_middle::ty::TyS>::discriminant_for_variant::he55d7c41489848d7
  12:     0x7f218c7160c7 - rustc_mir::interpret::operand::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::read_discriminant::h5f5c38f26e8b8ed8
  13:     0x7f218c79dbdd - rustc_mir::const_eval::destructure_const::h1f2cd6036022dfb8
  14:     0x7f218c32db46 - core::ops::function::FnOnce::call_once::h8c20fbb5bf3c1dd6
  15:     0x7f218d68c8ad - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::destructure_const>::compute::h3615046505938230
  16:     0x7f218d71cb09 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::ha13979abed354d04
  17:     0x7f218d88a1b6 - rustc_data_structures::stack::ensure_sufficient_stack::hb28e752bbf70f332
  18:     0x7f218d76be7a - rustc_query_system::query::plumbing::get_query_impl::h4795959616542474
  19:     0x7f218d663492 - rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_const::h42bd810d2dabec53
  20:     0x7f218d663db3 - rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_const::h42bd810d2dabec53
  21:     0x7f218d65472c - rustc_middle::mir::pretty_print_const::hd7cbc3a530cb0234
  22:     0x7f21882e1a3d - core::fmt::write::h65255e7874586eb2
  23:     0x7f21882e2db2 - <core::fmt::Formatter as core::fmt::Write>::write_fmt::h2cfc8f96fe0dc0bb
  24:     0x7f218d89f974 - <&T as core::fmt::Debug>::fmt::h61826e44f28f4f4a
  25:     0x7f21882e1a3d - core::fmt::write::h65255e7874586eb2
  26:     0x7f21882e2db2 - <core::fmt::Formatter as core::fmt::Write>::write_fmt::h2cfc8f96fe0dc0bb
  27:     0x7f218d651aa5 - <rustc_middle::mir::Operand as core::fmt::Debug>::fmt::hf2307fe080426e27
  28:     0x7f21882e1a3d - core::fmt::write::h65255e7874586eb2
  29:     0x7f21882e2db2 - <core::fmt::Formatter as core::fmt::Write>::write_fmt::h2cfc8f96fe0dc0bb
  30:     0x7f218d65223c - <rustc_middle::mir::Rvalue as core::fmt::Debug>::fmt::hd0f3169c5295fd5a
  31:     0x7f21882e1a3d - core::fmt::write::h65255e7874586eb2
  32:     0x7f21882e2db2 - <core::fmt::Formatter as core::fmt::Write>::write_fmt::h2cfc8f96fe0dc0bb
  33:     0x7f218d6513a8 - <rustc_middle::mir::Statement as core::fmt::Debug>::fmt::hc9cc86a23e746649
  34:     0x7f21882e19aa - core::fmt::write::h65255e7874586eb2
  35:     0x7f21882bf6ca - alloc::fmt::format::hc8afcfd973bb1a1f
  36:     0x7f218c366f71 - rustc_mir::util::pretty::write_mir_pretty::h93c9145185ddab0f
  37:     0x7f218c862c23 - rustc_mir::transform::dump_mir::emit_mir::h514eb69ae7eaa045
  38:     0x7f2189de7604 - rustc_interface::passes::start_codegen::h64d9c511ec596bff
  39:     0x7f2189e156d2 - rustc_middle::ty::context::tls::enter_global::hd5d9719ecc10b8ad
  40:     0x7f2189e0b77e - rustc_interface::queries::Queries::ongoing_codegen::h5a481c30c4739353
  41:     0x7f2189c37a0b - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h46a369817e38d2d4
  42:     0x7f2189ca17ca - rustc_span::with_source_map::ha1e1d15982d868c1
  43:     0x7f2189c39b49 - rustc_interface::interface::run_compiler_in_existing_thread_pool::hfd5622ef3ce026be
  44:     0x7f2189c1334e - scoped_tls::ScopedKey<T>::set::hd3c1397285b10bd3
  45:     0x7f2189c3a576 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3df4554cf04b61c9
  46:     0x7f2189c0717e - core::ops::function::FnOnce::call_once{{vtable.shim}}::hb0a109416f61afc2
  47:     0x7f2188279d7a - std::sys::unix::thread::Thread::new::thread_start::hb2effada6f868308
  48:     0x7f2187fa0422 - start_thread
  49:     0x7f21880bebf3 - __GI___clone
  50:                0x0 - <unknown>

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: rustc 1.45.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z mir-opt-level=1

query stack during panic:
#0 [destructure_const] destructure constant
end of query stack

@RalfJung
Copy link
Member

RalfJung commented Jun 5, 2020

Thanks, so that's inside read_discriminant, too. Curious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. F-never_type `#![feature(never_type)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants