Skip to content

ICE: debuginfo: Trying to create type name for unexpected type: T #112752

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

rustc --crate-type lib -Cdebuginfo=2

#![feature(type_alias_impl_trait)]

type Debuggable = impl core::fmt::Debug;

static mut TEST: Option<Debuggable> = None;

fn foo() -> Debuggable {
    0u32
}

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (e1c29d137 2023-06-17)
binary: rustc
commit-hash: e1c29d137dd779dcfce447d8d149ee6b8e9bdf78
commit-date: 2023-06-17
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.5

Error output


Backtrace

error: internal compiler error: compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs:426:13: debuginfo: Trying to create type name for unexpected type: Debuggable

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/compiler/rustc_errors/src/lib.rs:1650:9
stack backtrace:
   0:     0x7fae87d76821 - std::backtrace_rs::backtrace::libunwind::trace::h9f7459fe33aa0e5d
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fae87d76821 - std::backtrace_rs::backtrace::trace_unsynchronized::hd1b84c098fa4a123
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fae87d76821 - std::sys_common::backtrace::_print_fmt::hcbe1c0d5b9ccfafc
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fae87d76821 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h2397bfed2776bcc3
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fae87dd7b2f - core::fmt::rt::Argument::fmt::h9d127d2c0c6d41be
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/core/src/fmt/rt.rs:138:9
   5:     0x7fae87dd7b2f - core::fmt::write::h7eb0e863d034bdac
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/core/src/fmt/mod.rs:1094:21
   6:     0x7fae87d69a31 - std::io::Write::write_fmt::h0074615eecf66aee
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/std/src/io/mod.rs:1713:15
   7:     0x7fae87d76635 - std::sys_common::backtrace::_print::h6be5909ad9481635
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fae87d76635 - std::sys_common::backtrace::print::h797301c61028791e
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fae87d79317 - std::panicking::default_hook::{{closure}}::hca65d86a9a46dc15
  10:     0x7fae87d79104 - std::panicking::default_hook::he1fa9c1b7e1bd558
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/std/src/panicking.rs:288:9
  11:     0x7fae86baab0b - <rustc_driver_impl[279ee92520ace0a6]::install_ice_hook::{closure#0} as core[b4980bc44de3a097]::ops::function::FnOnce<(&core[b4980bc44de3a097]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7fae87d79a5d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h34cd7947431e4c22
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/alloc/src/boxed.rs:1999:9
  13:     0x7fae87d79a5d - std::panicking::rust_panic_with_hook::h65e494058e274a39
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/std/src/panicking.rs:709:13
  14:     0x7fae870ac051 - std[6ed0834f1ef78f33]::panicking::begin_panic::<rustc_errors[4119f672f666809f]::ExplicitBug>::{closure#0}
  15:     0x7fae870aaca6 - std[6ed0834f1ef78f33]::sys_common::backtrace::__rust_end_short_backtrace::<std[6ed0834f1ef78f33]::panicking::begin_panic<rustc_errors[4119f672f666809f]::ExplicitBug>::{closure#0}, !>
  16:     0x7fae8713fa56 - std[6ed0834f1ef78f33]::panicking::begin_panic::<rustc_errors[4119f672f666809f]::ExplicitBug>
  17:     0x7fae870a7a74 - <rustc_errors[4119f672f666809f]::HandlerInner>::bug::<alloc[92368cc95fb81602]::string::String>
  18:     0x7fae870a78f6 - <rustc_errors[4119f672f666809f]::Handler>::bug::<alloc[92368cc95fb81602]::string::String>
  19:     0x7fae870fae8c - rustc_middle[f4daec6bf88206fd]::util::bug::opt_span_bug_fmt::<rustc_span[d32f61a769cb4fd2]::span_encoding::Span>::{closure#0}
  20:     0x7fae870f7d2a - rustc_middle[f4daec6bf88206fd]::ty::context::tls::with_opt::<rustc_middle[f4daec6bf88206fd]::util::bug::opt_span_bug_fmt<rustc_span[d32f61a769cb4fd2]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7fae870f7cfa - rustc_middle[f4daec6bf88206fd]::ty::context::tls::with_context_opt::<rustc_middle[f4daec6bf88206fd]::ty::context::tls::with_opt<rustc_middle[f4daec6bf88206fd]::util::bug::opt_span_bug_fmt<rustc_span[d32f61a769cb4fd2]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7fae84ec768d - rustc_middle[f4daec6bf88206fd]::util::bug::bug_fmt
  23:     0x7fae84d7a9e7 - rustc_codegen_ssa[6aedebcb74c6a4d0]::debuginfo::type_names::push_debuginfo_type_name
  24:     0x7fae84d7e1ca - rustc_codegen_ssa[6aedebcb74c6a4d0]::debuginfo::type_names::push_generic_params_internal
  25:     0x7fae851262d5 - rustc_codegen_ssa[6aedebcb74c6a4d0]::debuginfo::type_names::compute_debuginfo_type_name
  26:     0x7fae8512606e - rustc_codegen_llvm[5855ca1d4f8b4fd6]::debuginfo::metadata::enums::native::build_enum_type_di_node
  27:     0x7fae8512586c - rustc_codegen_llvm[5855ca1d4f8b4fd6]::debuginfo::metadata::enums::build_enum_type_di_node
  28:     0x7fae8511b39b - rustc_codegen_llvm[5855ca1d4f8b4fd6]::debuginfo::metadata::type_di_node
  29:     0x7fae857a8dea - rustc_codegen_llvm[5855ca1d4f8b4fd6]::debuginfo::metadata::build_global_var_di_node
  30:     0x7fae857a8417 - <rustc_codegen_llvm[5855ca1d4f8b4fd6]::context::CodegenCx as rustc_codegen_ssa[6aedebcb74c6a4d0]::traits::statics::StaticMethods>::codegen_static
  31:     0x7fae8579157c - rustc_codegen_llvm[5855ca1d4f8b4fd6]::base::compile_codegen_unit::module_codegen
  32:     0x7fae8578edc9 - rustc_codegen_llvm[5855ca1d4f8b4fd6]::base::compile_codegen_unit
  33:     0x7fae8578c5c1 - rustc_codegen_ssa[6aedebcb74c6a4d0]::base::codegen_crate::<rustc_codegen_llvm[5855ca1d4f8b4fd6]::LlvmCodegenBackend>
  34:     0x7fae8578becf - <rustc_codegen_llvm[5855ca1d4f8b4fd6]::LlvmCodegenBackend as rustc_codegen_ssa[6aedebcb74c6a4d0]::traits::backend::CodegenBackend>::codegen_crate
  35:     0x7fae860da552 - <rustc_session[b39823bffb756516]::session::Session>::time::<alloc[92368cc95fb81602]::boxed::Box<dyn core[b4980bc44de3a097]::any::Any>, rustc_interface[f42202c9eb53a071]::passes::start_codegen::{closure#0}>
  36:     0x7fae860da0cb - rustc_interface[f42202c9eb53a071]::passes::start_codegen
  37:     0x7fae860d4e1d - <rustc_middle[f4daec6bf88206fd]::ty::context::GlobalCtxt>::enter::<<rustc_interface[f42202c9eb53a071]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[b4980bc44de3a097]::result::Result<alloc[92368cc95fb81602]::boxed::Box<dyn core[b4980bc44de3a097]::any::Any>, rustc_span[d32f61a769cb4fd2]::ErrorGuaranteed>>
  38:     0x7fae860d404d - <rustc_interface[f42202c9eb53a071]::queries::Queries>::ongoing_codegen
  39:     0x7fae860d3170 - <rustc_interface[f42202c9eb53a071]::interface::Compiler>::enter::<rustc_driver_impl[279ee92520ace0a6]::run_compiler::{closure#1}::{closure#2}, core[b4980bc44de3a097]::result::Result<core[b4980bc44de3a097]::option::Option<rustc_interface[f42202c9eb53a071]::queries::Linker>, rustc_span[d32f61a769cb4fd2]::ErrorGuaranteed>>
  40:     0x7fae860d0736 - std[6ed0834f1ef78f33]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[f42202c9eb53a071]::util::run_in_thread_pool_with_globals<rustc_interface[f42202c9eb53a071]::interface::run_compiler<core[b4980bc44de3a097]::result::Result<(), rustc_span[d32f61a769cb4fd2]::ErrorGuaranteed>, rustc_driver_impl[279ee92520ace0a6]::run_compiler::{closure#1}>::{closure#0}, core[b4980bc44de3a097]::result::Result<(), rustc_span[d32f61a769cb4fd2]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b4980bc44de3a097]::result::Result<(), rustc_span[d32f61a769cb4fd2]::ErrorGuaranteed>>
  41:     0x7fae860cfef5 - <<std[6ed0834f1ef78f33]::thread::Builder>::spawn_unchecked_<rustc_interface[f42202c9eb53a071]::util::run_in_thread_pool_with_globals<rustc_interface[f42202c9eb53a071]::interface::run_compiler<core[b4980bc44de3a097]::result::Result<(), rustc_span[d32f61a769cb4fd2]::ErrorGuaranteed>, rustc_driver_impl[279ee92520ace0a6]::run_compiler::{closure#1}>::{closure#0}, core[b4980bc44de3a097]::result::Result<(), rustc_span[d32f61a769cb4fd2]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b4980bc44de3a097]::result::Result<(), rustc_span[d32f61a769cb4fd2]::ErrorGuaranteed>>::{closure#1} as core[b4980bc44de3a097]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  42:     0x7fae87d83f55 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::heee60d66f5fcaf5d
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/alloc/src/boxed.rs:1985:9
  43:     0x7fae87d83f55 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd90650fb45aa2fdd
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/alloc/src/boxed.rs:1985:9
  44:     0x7fae87d83f55 - std::sys::unix::thread::Thread::new::thread_start::h328d7dcc74e3b33a
                               at /rustc/e1c29d137dd779dcfce447d8d149ee6b8e9bdf78/library/std/src/sys/unix/thread.rs:108:17
  45:     0x7fae8389d44b - <unknown>
  46:     0x7fae83920e40 - <unknown>
  47:                0x0 - <unknown>

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.72.0-nightly (e1c29d137 2023-06-17) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C debuginfo=2

query stack during panic:
end of query stack
error: aborting due to previous error; 3 warnings emitted

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions