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

Unsafe binders unsupported in debug info #139462

Open
ds84182 opened this issue Apr 7, 2025 · 0 comments
Open

Unsafe binders unsupported in debug info #139462

ds84182 opened this issue Apr 7, 2025 · 0 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. F-unsafe_binders `#![feature(unsafe_binders)]` 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.

Comments

@ds84182
Copy link

ds84182 commented Apr 7, 2025

Code

(I hit this on Rust Playground, so I can't attach the ICE txt file. Works fine in release mode.)

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=4f0a92174d7eca28addc51f8b4612742

#![feature(unsafe_binders)]
use std::unsafe_binder::wrap_binder;
fn main() {
    let foo = 0;
    let foo: unsafe<'a> &'a u32 = unsafe { wrap_binder!(&foo) };
}

Meta

rustc --version --verbose:

1.88.0-nightly (2025-04-06 2fa8b11f0933dae9b4e5)

Error output

error: internal compiler error: compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:462:14: debuginfo: unexpected type in type_di_node(): Binder { value: &'^0 u32, bound_vars: [Region(BrAnon)] }
Backtrace

thread 'rustc' panicked at compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:462:14:
Box<dyn Any>
stack backtrace:
   0:     0x7a54b46955e3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h54e65d53802d6f14
   1:     0x7a54b4e06111 - core::fmt::write::h2ab2627ac6040071
   2:     0x7a54b61ec651 - std::io::Write::write_fmt::h7c79906be33e14fb
   3:     0x7a54b4695442 - std::sys::backtrace::BacktraceLock::print::h277faba49a014a7d
   4:     0x7a54b4698f2a - std::panicking::default_hook::{{closure}}::hd2f15c305ca8b86e
   5:     0x7a54b4698aaf - std::panicking::default_hook::h057d80f2dca97b6e
   6:     0x7a54b36f1a73 - std[d02962fe56d99dcc]::panicking::update_hook::<alloc[4b3f7a816ac45d68]::boxed::Box<rustc_driver_impl[8b13fa2b174f7f62]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7a54b46997a3 - std::panicking::rust_panic_with_hook::h928afe7ce4f23dbb
   8:     0x7a54b3730131 - std[d02962fe56d99dcc]::panicking::begin_panic::<rustc_errors[736ca0fcc4929ac3]::ExplicitBug>::{closure#0}
   9:     0x7a54b37241a6 - std[d02962fe56d99dcc]::sys::backtrace::__rust_end_short_backtrace::<std[d02962fe56d99dcc]::panicking::begin_panic<rustc_errors[736ca0fcc4929ac3]::ExplicitBug>::{closure#0}, !>
  10:     0x7a54b3720b9b - std[d02962fe56d99dcc]::panicking::begin_panic::<rustc_errors[736ca0fcc4929ac3]::ExplicitBug>
  11:     0x7a54b3739981 - <rustc_errors[736ca0fcc4929ac3]::diagnostic::BugAbort as rustc_errors[736ca0fcc4929ac3]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7a54b3d8f7da - rustc_middle[63a048d087a3442e]::util::bug::opt_span_bug_fmt::<rustc_span[51c212edee1a24cc]::span_encoding::Span>::{closure#0}
  13:     0x7a54b3d6962a - rustc_middle[63a048d087a3442e]::ty::context::tls::with_opt::<rustc_middle[63a048d087a3442e]::util::bug::opt_span_bug_fmt<rustc_span[51c212edee1a24cc]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7a54b3d6949b - rustc_middle[63a048d087a3442e]::ty::context::tls::with_context_opt::<rustc_middle[63a048d087a3442e]::ty::context::tls::with_opt<rustc_middle[63a048d087a3442e]::util::bug::opt_span_bug_fmt<rustc_span[51c212edee1a24cc]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x7a54b1f50dc0 - rustc_middle[63a048d087a3442e]::util::bug::bug_fmt
  16:     0x7a54b55444a1 - rustc_codegen_llvm[ba3e838039641cce]::debuginfo::metadata::type_di_node
  17:     0x7a54b5542212 - <rustc_codegen_llvm[ba3e838039641cce]::context::GenericCx<rustc_codegen_llvm[ba3e838039641cce]::context::FullCx> as rustc_codegen_ssa[98c2f8fc06024765]::traits::debuginfo::DebugInfoCodegenMethods>::create_dbg_var
  18:     0x7a54b5eaf586 - rustc_codegen_ssa[98c2f8fc06024765]::mir::codegen_mir::<rustc_codegen_llvm[ba3e838039641cce]::builder::GenericBuilder<rustc_codegen_llvm[ba3e838039641cce]::context::FullCx>>
  19:     0x7a54b5eaa08f - rustc_codegen_llvm[ba3e838039641cce]::base::compile_codegen_unit::module_codegen
  20:     0x7a54b5fcde56 - <rustc_codegen_llvm[ba3e838039641cce]::LlvmCodegenBackend as rustc_codegen_ssa[98c2f8fc06024765]::traits::backend::ExtraBackendMethods>::compile_codegen_unit
  21:     0x7a54b5fca117 - <rustc_codegen_llvm[ba3e838039641cce]::LlvmCodegenBackend as rustc_codegen_ssa[98c2f8fc06024765]::traits::backend::CodegenBackend>::codegen_crate
  22:     0x7a54b5c6eb9d - <rustc_interface[8d837187d32f3597]::queries::Linker>::codegen_and_build_linker
  23:     0x7a54b61164ac - rustc_interface[8d837187d32f3597]::passes::create_and_enter_global_ctxt::<core[d62cfdcf594127e5]::option::Option<rustc_interface[8d837187d32f3597]::queries::Linker>, rustc_driver_impl[8b13fa2b174f7f62]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  24:     0x7a54b5f841b9 - rustc_interface[8d837187d32f3597]::interface::run_compiler::<(), rustc_driver_impl[8b13fa2b174f7f62]::run_compiler::{closure#0}>::{closure#1}
  25:     0x7a54b5d7d005 - std[d02962fe56d99dcc]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[8d837187d32f3597]::util::run_in_thread_with_globals<rustc_interface[8d837187d32f3597]::util::run_in_thread_pool_with_globals<rustc_interface[8d837187d32f3597]::interface::run_compiler<(), rustc_driver_impl[8b13fa2b174f7f62]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  26:     0x7a54b5d7d8eb - <<std[d02962fe56d99dcc]::thread::Builder>::spawn_unchecked_<rustc_interface[8d837187d32f3597]::util::run_in_thread_with_globals<rustc_interface[8d837187d32f3597]::util::run_in_thread_pool_with_globals<rustc_interface[8d837187d32f3597]::interface::run_compiler<(), rustc_driver_impl[8b13fa2b174f7f62]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[d62cfdcf594127e5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  27:     0x7a54b5d7ecf7 - std::sys::pal::unix::thread::Thread::new::thread_start::hf081d5b83a5b7148
  28:     0x7a54b7583a94 - <unknown>
  29:     0x7a54b7610a34 - clone
  30:                0x0 - <unknown>

@ds84182 ds84182 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 Apr 7, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 7, 2025
@jieyouxu jieyouxu added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) F-unsafe_binders `#![feature(unsafe_binders)]` and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. F-unsafe_binders `#![feature(unsafe_binders)]` 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.
Projects
None yet
Development

No branches or pull requests

3 participants