Skip to content

ICE: debuginfo: unexpected type in type_di_node() #112731

Closed

Description

@matthiaskrgr

Code

rustc -Cdebuginfo=2 --crate-type lib

#![feature(type_alias_impl_trait)]

use std::fmt::Debug;

type Foo = impl Debug;

static FOO1: Foo = 22_u32;

Meta

rustc --version --verbose:

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

Error output

<output>
Backtrace

error: internal compiler error: compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:462:14: debuginfo: unexpected type in type_di_node(): Foo

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/compiler/rustc_errors/src/lib.rs:1650:9
stack backtrace:
   0:     0x7f162fd68821 - std::backtrace_rs::backtrace::libunwind::trace::h6e3584f9aa263648
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f162fd68821 - std::backtrace_rs::backtrace::trace_unsynchronized::h7cba45a2d56b3723
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f162fd68821 - std::sys_common::backtrace::_print_fmt::hb3e5f2b800058c47
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f162fd68821 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc6fcd56f05592786
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f162fdc9b2f - core::fmt::rt::Argument::fmt::hb8b6762d96a2930c
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/core/src/fmt/rt.rs:138:9
   5:     0x7f162fdc9b2f - core::fmt::write::ha824b1be2c398991
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f162fd5ba31 - std::io::Write::write_fmt::h4bbc557c498e18be
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/io/mod.rs:1713:15
   7:     0x7f162fd68635 - std::sys_common::backtrace::_print::hb6a2afc924d1ac9a
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f162fd68635 - std::sys_common::backtrace::print::h39a60e9b1dd2b988
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f162fd6b317 - std::panicking::default_hook::{{closure}}::hf1636ea70b88baf6
  10:     0x7f162fd6b104 - std::panicking::default_hook::h25db0e741a15cb6c
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/panicking.rs:288:9
  11:     0x7f1632fc105b - <rustc_driver_impl[9fb98086b5dc1b8]::install_ice_hook::{closure#0} as core[5a025f5ac19a3684]::ops::function::FnOnce<(&core[5a025f5ac19a3684]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7f162fd6ba5d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hb67fc0de76dc4685
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/alloc/src/boxed.rs:1999:9
  13:     0x7f162fd6ba5d - std::panicking::rust_panic_with_hook::h6c10fd1f40066f99
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/panicking.rs:709:13
  14:     0x7f16334c21b1 - std[5e6a7ab4ec51e2fa]::panicking::begin_panic::<rustc_errors[db6e693a4d78f721]::ExplicitBug>::{closure#0}
  15:     0x7f16334c0e06 - std[5e6a7ab4ec51e2fa]::sys_common::backtrace::__rust_end_short_backtrace::<std[5e6a7ab4ec51e2fa]::panicking::begin_panic<rustc_errors[db6e693a4d78f721]::ExplicitBug>::{closure#0}, !>
  16:     0x7f16335572a6 - std[5e6a7ab4ec51e2fa]::panicking::begin_panic::<rustc_errors[db6e693a4d78f721]::ExplicitBug>
  17:     0x7f16334bdbd4 - <rustc_errors[db6e693a4d78f721]::HandlerInner>::bug::<alloc[31842ca5441cdb56]::string::String>
  18:     0x7f16334bda56 - <rustc_errors[db6e693a4d78f721]::Handler>::bug::<alloc[31842ca5441cdb56]::string::String>
  19:     0x7f163351142c - rustc_middle[c2d4873b804b2cf0]::util::bug::opt_span_bug_fmt::<rustc_span[7bbc48c8a570ee79]::span_encoding::Span>::{closure#0}
  20:     0x7f163350e2ca - rustc_middle[c2d4873b804b2cf0]::ty::context::tls::with_opt::<rustc_middle[c2d4873b804b2cf0]::util::bug::opt_span_bug_fmt<rustc_span[7bbc48c8a570ee79]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f163350e29a - rustc_middle[c2d4873b804b2cf0]::ty::context::tls::with_context_opt::<rustc_middle[c2d4873b804b2cf0]::ty::context::tls::with_opt<rustc_middle[c2d4873b804b2cf0]::util::bug::opt_span_bug_fmt<rustc_span[7bbc48c8a570ee79]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f163124f89d - rustc_middle[c2d4873b804b2cf0]::util::bug::bug_fmt
  23:     0x7f16314d0a24 - rustc_codegen_llvm[69782307a30a28b1]::debuginfo::metadata::type_di_node
  24:     0x7f1631c240ba - rustc_codegen_llvm[69782307a30a28b1]::debuginfo::metadata::build_global_var_di_node
  25:     0x7f1631c236e7 - <rustc_codegen_llvm[69782307a30a28b1]::context::CodegenCx as rustc_codegen_ssa[7cf51ec1c1d8e70f]::traits::statics::StaticMethods>::codegen_static
  26:     0x7f1631c0c8bc - rustc_codegen_llvm[69782307a30a28b1]::base::compile_codegen_unit::module_codegen
  27:     0x7f1631c0a109 - rustc_codegen_llvm[69782307a30a28b1]::base::compile_codegen_unit
  28:     0x7f1631c07901 - rustc_codegen_ssa[7cf51ec1c1d8e70f]::base::codegen_crate::<rustc_codegen_llvm[69782307a30a28b1]::LlvmCodegenBackend>
  29:     0x7f1631c0720f - <rustc_codegen_llvm[69782307a30a28b1]::LlvmCodegenBackend as rustc_codegen_ssa[7cf51ec1c1d8e70f]::traits::backend::CodegenBackend>::codegen_crate
  30:     0x7f16324fc0a2 - <rustc_session[5d8f1134011332b9]::session::Session>::time::<alloc[31842ca5441cdb56]::boxed::Box<dyn core[5a025f5ac19a3684]::any::Any>, rustc_interface[75da62af7afad68]::passes::start_codegen::{closure#0}>
  31:     0x7f16324fbc1b - rustc_interface[75da62af7afad68]::passes::start_codegen
  32:     0x7f16324f696d - <rustc_middle[c2d4873b804b2cf0]::ty::context::GlobalCtxt>::enter::<<rustc_interface[75da62af7afad68]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[5a025f5ac19a3684]::result::Result<alloc[31842ca5441cdb56]::boxed::Box<dyn core[5a025f5ac19a3684]::any::Any>, rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>
  33:     0x7f16324f50dd - <rustc_interface[75da62af7afad68]::queries::Queries>::ongoing_codegen
  34:     0x7f16324f3c3a - rustc_span[7bbc48c8a570ee79]::set_source_map::<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_interface[75da62af7afad68]::interface::run_compiler<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_driver_impl[9fb98086b5dc1b8]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  35:     0x7f16324ec3f9 - <scoped_tls[5be461245172b0fd]::ScopedKey<rustc_span[7bbc48c8a570ee79]::SessionGlobals>>::set::<rustc_interface[75da62af7afad68]::interface::run_compiler<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_driver_impl[9fb98086b5dc1b8]::run_compiler::{closure#1}>::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>
  36:     0x7f16324eb9f6 - std[5e6a7ab4ec51e2fa]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[75da62af7afad68]::util::run_in_thread_pool_with_globals<rustc_interface[75da62af7afad68]::interface::run_compiler<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_driver_impl[9fb98086b5dc1b8]::run_compiler::{closure#1}>::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>
  37:     0x7f16324eb7a5 - <<std[5e6a7ab4ec51e2fa]::thread::Builder>::spawn_unchecked_<rustc_interface[75da62af7afad68]::util::run_in_thread_pool_with_globals<rustc_interface[75da62af7afad68]::interface::run_compiler<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_driver_impl[9fb98086b5dc1b8]::run_compiler::{closure#1}>::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>::{closure#1} as core[5a025f5ac19a3684]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  38:     0x7f162fd75f55 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3b57fe0fe8253eda
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/alloc/src/boxed.rs:1985:9
  39:     0x7f162fd75f55 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6eac2c7c988070fa
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/alloc/src/boxed.rs:1985:9
  40:     0x7f162fd75f55 - std::sys::unix::thread::Thread::new::thread_start::h8d73f1104f34aa7b
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys/unix/thread.rs:108:17
  41:     0x7f162fb0f44b - <unknown>
  42:     0x7f162fb92e40 - <unknown>
  43:                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 (1d7d82472 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

Activity

  1. added
    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.
    C-bugCategory: This is a bug.
    on Jun 17, 2023
  2. matthiaskrgr commented on Jun 17, 2023

    @matthiaskrgr
    MemberAuthor
  3. added
    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)
    on Jun 17, 2023
  4. added a commit that references this issue on Jun 19, 2023
    7fe7a98
  5. added 2 commits that reference this issue on Jun 19, 2023
    c8bc2a9
    68f2f1e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationA-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.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