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

error: internal compiler error: compiler/rustc_passes/src/dead.rs:122:13: no type-dependent def for method #88643

Closed
battjt opened this issue Sep 4, 2021 · 7 comments · Fixed by #97508
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@battjt
Copy link

battjt commented Sep 4, 2021

Code

I'm too new to rust to know what part of this project is causing the compiler to crash, so I made a branch for it and removed the dependency on fltk. https://github.com/battjt/cb-test/blob/rustc_bug/src/main.rs

Meta

Same failure in nightly, beta, and stable
rustc --version --verbose:

joe@think:~/cb-test$ rustc --version --verbose
rustc 1.55.0-beta.9 (27e88d367 2021-08-28)
binary: rustc
commit-hash: 27e88d367c140907655bae9c7975fac411a5c344
commit-date: 2021-08-28
host: x86_64-unknown-linux-gnu
release: 1.55.0-beta.9
LLVM version: 12.0.1
joe@think:~/cb-test$ rustup default stable
info: using existing install for 'stable-x86_64-unknown-linux-gnu'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.54.0 (a178d0322 2021-07-26)

joe@think:~/cb-test$ rustc --version --verbose
rustc 1.54.0 (a178d0322 2021-07-26)
binary: rustc
commit-hash: a178d0322ce20e33eac124758e837cbd80a6f633
commit-date: 2021-07-26
host: x86_64-unknown-linux-gnu
release: 1.54.0
LLVM version: 12.0.1
joe@think:~/cb-test$

Error output

joe@think:~/cb-test$ RUST_BACKTRACE=1 cargo run
   Compiling cb-test v0.1.0 (/home/joe/cb-test)
error: internal compiler error: compiler/rustc_passes/src/dead.rs:122:13: no type-dependent def for method

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1034:9
stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_errors::HandlerInner::bug
   3: rustc_errors::Handler::bug
   4: rustc_middle::ty::context::tls::with_opt
   5: rustc_middle::util::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::bug_fmt
   7: <rustc_passes::dead::MarkSymbolVisitor as rustc_hir::intravisit::Visitor>::visit_expr
   8: rustc_hir::intravisit::walk_expr
   9: rustc_hir::intravisit::walk_fn
  10: rustc_hir::intravisit::walk_impl_item
  11: rustc_passes::dead::check_crate
  12: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  13: rustc_session::utils::<impl rustc_session::session::Session>::time
  14: rustc_interface::passes::analysis
  15: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  16: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  17: rustc_query_system::dep_graph::graph::DepGraph<K>::with_eval_always_task
  18: rustc_data_structures::stack::ensure_sufficient_stack
  19: rustc_query_system::query::plumbing::force_query_with_job
  20: rustc_query_system::query::plumbing::get_query_impl
  21: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  22: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  23: rustc_span::with_source_map
  24: rustc_interface::interface::create_compiler_and_run
  25: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.55.0-beta.9 (27e88d367 2021-08-28) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `cb-test`

@battjt battjt 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 Sep 4, 2021
@matthiaskrgr
Copy link
Member

reduced a bit:

use std::collections::HashMap;

struct Widget {}

pub trait WidgetExt {
    fn set_callback<F: FnMut(&mut Self) + 'static>(&mut self, cb: F)
    where
        Self: Sized;
}

static CALLBACKS: HashMap<*const dyn WidgetExt, dyn FnMut(&mut _) + 'static> = HashMap::new();

pub fn main() {}
warning: 2 warnings emitted

error: internal compiler error: bad_placeholder_type
  --> ice.rs:11:64
   |
11 | static CALLBACKS: HashMap<*const dyn WidgetExt, dyn FnMut(&mut _) + 'static> = HashMap::new();
   |                                                                ^
   |
   = note: delayed at compiler/rustc_typeck/src/collect.rs:390:20

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_typeck/src/astconv/mod.rs:532:48

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/compiler/rustc_middle/src/ty/relate.rs:382:59

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_infer/src/infer/sub.rs:121:31

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_typeck/src/check/coercion.rs:157:49

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_typeck/src/check/fallback.rs:89:58

error: internal compiler error: cat_expr Errd
  --> ice.rs:11:80
   |
11 | static CALLBACKS: HashMap<*const dyn WidgetExt, dyn FnMut(&mut _) + 'static> = HashMap::new();
   |                                                                                ^^^^^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_typeck/src/check/regionck.rs:408:31

error: internal compiler error: cat_expr Errd
  --> ice.rs:11:80
   |
11 | static CALLBACKS: HashMap<*const dyn WidgetExt, dyn FnMut(&mut _) + 'static> = HashMap::new();
   |                                                                                ^^^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_typeck/src/check/regionck.rs:408:31

error: internal compiler error: generic static must be rejected
  --> ice.rs:11:1
   |
11 | static CALLBACKS: HashMap<*const dyn WidgetExt, dyn FnMut(&mut _) + 'static> = HashMap::new();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_typeck/src/check/check.rs:424:22

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_mir_build/src/build/mod.rs:716:18

error: internal compiler error: mir_const_qualif: MIR had errors
  --> ice.rs:11:1
   |
11 | static CALLBACKS: HashMap<*const dyn WidgetExt, dyn FnMut(&mut _) + 'static> = HashMap::new();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_mir/src/transform/mod.rs:238:18

error: internal compiler error: PromoteTemps: MIR had errors
  --> ice.rs:11:1
   |
11 | static CALLBACKS: HashMap<*const dyn WidgetExt, dyn FnMut(&mut _) + 'static> = HashMap::new();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_mir/src/transform/promote_consts.rs:51:22

error: internal compiler error: broken MIR in DefId(0:10 ~ ice[9cac]::CALLBACKS) ("return type"): bad type [type error]
  --> ice.rs:11:1
   |
11 | static CALLBACKS: HashMap<*const dyn WidgetExt, dyn FnMut(&mut _) + 'static> = HashMap::new();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:308:27

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:777:20

error: internal compiler error: broken MIR in DefId(0:10 ~ ice[9cac]::CALLBACKS) (LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: None, ty: [type error], user_ty: None, source_info: SourceInfo { span: ice.rs:11:1: 11:95 (#0), scope: scope[0] } }): bad type [type error]
  --> ice.rs:11:1
   |
11 | static CALLBACKS: HashMap<*const dyn WidgetExt, dyn FnMut(&mut _) + 'static> = HashMap::new();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:308:27

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1166:13
stack backtrace:
   0:     0x7efc859b74dc - std::backtrace_rs::backtrace::libunwind::trace::h788b2853b7016c32
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7efc859b74dc - std::backtrace_rs::backtrace::trace_unsynchronized::h3626590e16510efa
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7efc859b74dc - std::sys_common::backtrace::_print_fmt::ha76294ed367b5eb6
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7efc859b74dc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4244b134876ede81
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7efc85a151ec - core::fmt::write::h9a6d9c74526a6c1b
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/core/src/fmt/mod.rs:1150:17
   5:     0x7efc859a8415 - std::io::Write::write_fmt::h7f8a2ef72f011ad9
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/io/mod.rs:1667:15
   6:     0x7efc859baa40 - std::sys_common::backtrace::_print::h4b3c9553c91f7522
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7efc859baa40 - std::sys_common::backtrace::print::h36fb46a493801fb8
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7efc859baa40 - std::panicking::default_hook::{{closure}}::hf28f6810f0e04677
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/panicking.rs:210:50
   9:     0x7efc859ba5f7 - std::panicking::default_hook::hadb819fa279f9d7b
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/panicking.rs:227:9
  10:     0x7efc8618e7b1 - rustc_driver::DEFAULT_HOOK::{{closure}}::{{closure}}::hf7804370e2af68fc
  11:     0x7efc859bb259 - std::panicking::rust_panic_with_hook::h015085c4aa271d26
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/panicking.rs:628:17
  12:     0x7efc859bad10 - std::panicking::begin_panic_handler::{{closure}}::h15a8a2888dd1ba59
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/panicking.rs:521:13
  13:     0x7efc859b7984 - std::sys_common::backtrace::__rust_end_short_backtrace::h673e204498e49379
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/sys_common/backtrace.rs:141:18
  14:     0x7efc859bac79 - rust_begin_unwind
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/panicking.rs:517:5
  15:     0x7efc8597f7fb - std::panicking::begin_panic_fmt::hc0c200f2fa4ef986
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/panicking.rs:460:5
  16:     0x7efc886f109e - rustc_errors::HandlerInner::flush_delayed::hfa770e96c4015d8d
  17:     0x7efc886ef91d - <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop::hc2269e7aaf41b216
  18:     0x7efc87cb1976 - core::ptr::drop_in_place<rustc_session::parse::ParseSess>::h72dc1432dfff01af
  19:     0x7efc87cb3a1e - <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop::h644fed3d75172bde
  20:     0x7efc87c858cd - core::ptr::drop_in_place<rustc_interface::interface::Compiler>::hebdcf30a25eaa413
  21:     0x7efc87c855bc - rustc_span::with_source_map::h0c688eed363cc6b3
  22:     0x7efc87c976ac - scoped_tls::ScopedKey<T>::set::h3412736d21354023
  23:     0x7efc87c8681b - std::sys_common::backtrace::__rust_begin_short_backtrace::h2eadc68631dd2604
  24:     0x7efc87c839e5 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h05dec0a08a1dc2b4
  25:     0x7efc859c78a3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h334de5469f492d6e
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/alloc/src/boxed.rs:1636:9
  26:     0x7efc859c78a3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h24abb7dc135c5761
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/alloc/src/boxed.rs:1636:9
  27:     0x7efc859c78a3 - std::sys::unix::thread::Thread::new::thread_start::h09d0eb3bf5e9d59a
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/sys/unix/thread.rs:106:17
  28:     0x7efc858cf259 - start_thread
  29:     0x7efc857e45e3 - __GI___clone
  30:                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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.56.0-nightly (b7404c898 2021-09-03) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
[2]    3704753 illegal hardware instruction (core dumped)  rustc ice.rs

@matthiaskrgr
Copy link
Member

@rustbot prioritize
since this is also a stable/beta ICE

@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Sep 4, 2021
matthiaskrgr added a commit to matthiaskrgr/glacier that referenced this issue Sep 5, 2021
@cbeuw
Copy link
Contributor

cbeuw commented Sep 5, 2021

Further reduced:

use std::collections::HashMap;

pub trait T {}

static CALLBACKS: HashMap<*const dyn T, dyn FnMut(&mut _) + 'static> = HashMap::new();

pub fn main() {}

@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Sep 5, 2021
@klensy
Copy link
Contributor

klensy commented Sep 5, 2021

Panic location slightly differs:

static CALLBACKS: Vec<dyn Fn(& _)> = Vec::new();
warning: static is never used: `CALLBACKS`
 --> <source>:2:1
  |
2 | static CALLBACKS: Vec<dyn Fn(& _)> = Vec::new();
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: ErrorReported', compiler/rustc_mir/src/monomorphize/collector.rs:894:84
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.56.0-nightly (b7404c898 2021-09-03) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=1 -C llvm-args=--x86-asm-syntax=intel --crate-type rlib

query stack during panic:
#0 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
warning: 1 warning emitted

error: internal compiler error: bad_placeholder_type
 --> <source>:2:32
  |
2 | static CALLBACKS: Vec<dyn Fn(& _)> = Vec::new();
  |                                ^
  |
  = note: delayed at compiler/rustc_typeck/src/collect.rs:390:20

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_typeck/src/astconv/mod.rs:532:48

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/compiler/rustc_middle/src/ty/relate.rs:382:59

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_infer/src/infer/sub.rs:121:31

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_typeck/src/check/coercion.rs:157:49

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_typeck/src/check/fallback.rs:89:58

error: internal compiler error: cat_expr Errd
 --> <source>:2:38
  |
2 | static CALLBACKS: Vec<dyn Fn(& _)> = Vec::new();
  |                                      ^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_typeck/src/check/regionck.rs:408:31

error: internal compiler error: cat_expr Errd
 --> <source>:2:38
  |
2 | static CALLBACKS: Vec<dyn Fn(& _)> = Vec::new();
  |                                      ^^^^^^^^
  |
  = note: delayed at compiler/rustc_typeck/src/check/regionck.rs:408:31

error: internal compiler error: generic static must be rejected
 --> <source>:2:1
  |
2 | static CALLBACKS: Vec<dyn Fn(& _)> = Vec::new();
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_typeck/src/check/check.rs:424:22

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_mir_build/src/build/mod.rs:716:18

error: internal compiler error: mir_const_qualif: MIR had errors
 --> <source>:2:1
  |
2 | static CALLBACKS: Vec<dyn Fn(& _)> = Vec::new();
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_mir/src/transform/mod.rs:238:18

error: internal compiler error: PromoteTemps: MIR had errors
 --> <source>:2:1
  |
2 | static CALLBACKS: Vec<dyn Fn(& _)> = Vec::new();
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_mir/src/transform/promote_consts.rs:51:22

error: internal compiler error: broken MIR in DefId(0:3 ~ example[dce1]::CALLBACKS) ("return type"): bad type [type error]
 --> <source>:2:1
  |
2 | static CALLBACKS: Vec<dyn Fn(& _)> = Vec::new();
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:308:27

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:777:20

error: internal compiler error: broken MIR in DefId(0:3 ~ example[dce1]::CALLBACKS) (LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: None, ty: [type error], user_ty: None, source_info: SourceInfo { span: <source>:2:1: 2:49 (#0), scope: scope[0] } }): bad type [type error]
 --> <source>:2:1
  |
2 | static CALLBACKS: Vec<dyn Fn(& _)> = Vec::new();
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:308:27

error: internal compiler error: encountered ambiguity selecting `Binder(<std::vec::Vec<dyn for<'r> std::ops::Fn(&'r [type error]), [type error]> as std::ops::Drop>, [])` during codegen, presuming due to overflow or prior type error
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/codegen.rs:55:32

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1166:13
stack backtrace:
   0:     0x7f72893304dc - std::backtrace_rs::backtrace::libunwind::trace::h788b2853b7016c32
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7f72893304dc - std::backtrace_rs::backtrace::trace_unsynchronized::h3626590e16510efa
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f72893304dc - std::sys_common::backtrace::_print_fmt::ha76294ed367b5eb6
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f72893304dc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4244b134876ede81
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f728938e1ec - core::fmt::write::h9a6d9c74526a6c1b
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/core/src/fmt/mod.rs:1150:17
   5:     0x7f7289321415 - std::io::Write::write_fmt::h7f8a2ef72f011ad9
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/io/mod.rs:1667:15
   6:     0x7f7289333a40 - std::sys_common::backtrace::_print::h4b3c9553c91f7522
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f7289333a40 - std::sys_common::backtrace::print::h36fb46a493801fb8
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f7289333a40 - std::panicking::default_hook::{{closure}}::hf28f6810f0e04677
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/panicking.rs:210:50
   9:     0x7f72893335f7 - std::panicking::default_hook::hadb819fa279f9d7b
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/panicking.rs:227:9
  10:     0x7f7289b077b1 - rustc_driver::DEFAULT_HOOK::{{closure}}::{{closure}}::hf7804370e2af68fc
  11:     0x7f7289334259 - std::panicking::rust_panic_with_hook::h015085c4aa271d26
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/panicking.rs:628:17
  12:     0x7f7289333d10 - std::panicking::begin_panic_handler::{{closure}}::h15a8a2888dd1ba59
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/panicking.rs:521:13
  13:     0x7f7289330984 - std::sys_common::backtrace::__rust_end_short_backtrace::h673e204498e49379
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/sys_common/backtrace.rs:141:18
  14:     0x7f7289333c79 - rust_begin_unwind
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/panicking.rs:517:5
  15:     0x7f72892f87fb - std::panicking::begin_panic_fmt::hc0c200f2fa4ef986
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/panicking.rs:460:5
  16:     0x7f728c06a09e - rustc_errors::HandlerInner::flush_delayed::hfa770e96c4015d8d
  17:     0x7f728c06891d - <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop::hc2269e7aaf41b216
  18:     0x7f728b62a976 - core::ptr::drop_in_place<rustc_session::parse::ParseSess>::h72dc1432dfff01af
  19:     0x7f728b62ca1e - <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop::h644fed3d75172bde
  20:     0x7f728b5fe8cd - core::ptr::drop_in_place<rustc_interface::interface::Compiler>::hebdcf30a25eaa413
  21:     0x7f728b5fe5bc - rustc_span::with_source_map::h0c688eed363cc6b3
  22:     0x7f728b6106ac - scoped_tls::ScopedKey<T>::set::h3412736d21354023
  23:     0x7f728b5ff81b - std::sys_common::backtrace::__rust_begin_short_backtrace::h2eadc68631dd2604
  24:     0x7f728b5fc9e5 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h05dec0a08a1dc2b4
  25:     0x7f72893408a3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h334de5469f492d6e
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/alloc/src/boxed.rs:1636:9
  26:     0x7f72893408a3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h24abb7dc135c5761
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/alloc/src/boxed.rs:1636:9
  27:     0x7f72893408a3 - std::sys::unix::thread::Thread::new::thread_start::h09d0eb3bf5e9d59a
                               at /rustc/b7404c898a1a6933b71c72428a6dce551bcc1be7/library/std/src/sys/unix/thread.rs:106:17
  28:     0x7f728927c609 - start_thread
  29:     0x7f7289190293 - clone
  30:                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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.56.0-nightly (b7404c898 2021-09-03) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=1 -C llvm-args=--x86-asm-syntax=intel --crate-type rlib

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
Compiler returned: 132

@MoAlyousef
Copy link

^ also replacing Vec with Option reveals a broken LLVM module.

@apiraino
Copy link
Contributor

Assigning priority as discussed in the Zulip thread of the Prioritization Working Group.

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 22, 2021
@stephanemagnenat
Copy link

I just encountered a similar ICE with a slightly different source code (in the context of building a task planner). Here is the minimized code in playground:

trait Task<D> {}
struct Domain;
struct Collect;
impl Task<Domain> for Collect {}

fn main() {
    const POSSIBLE_TASKS: [dyn Task<_>] = [Collect];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
9 participants