Skip to content

ICE due to name mangling not having been implemented yet for unsafe binders #154367

@Anonymous1-design

Description

@Anonymous1-design

Code

#![feature(unsafe_binders)]
use std::mem::zeroed;
trait DoStuff {
    fn do_it();
}
struct MyImpl;
impl DoStuff for MyImpl {
    fn do_it() {
        let x0: unsafe<'a> &'a () = unsafe { zeroed() }; 
        let x1: i32 = 42;
    }
}
fn main() {
    MyImpl::do_it();
}

Meta

rustc --version --verbose:

rustc 1.96.0-nightly (b41f22de2 2026-03-08)
binary: rustc
commit-hash: b41f22de2a13a0babd28771e96feef4c309f54aa
commit-date: 2026-03-08
host: x86_64-unknown-linux-gnu
release: 1.96.0-nightly
LLVM version: 22.1.0
Backtrace

thread 'rustc' (2368628) panicked at /rustc-dev/b41f22de2a13a0babd28771e96feef4c309f54aa/compiler/rustc_symbol_mangling/src/v0.rs:582:37:
not yet implemented
stack backtrace:
   0:     0x7f96e3b8b54b - <<std[f377252fd1978e75]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[40ef8ddb62afa269]::fmt::Display>::fmt
   1:     0x7f96e424e288 - core[40ef8ddb62afa269]::fmt::write
   2:     0x7f96e3ba2556 - <std[f377252fd1978e75]::sys::stdio::unix::Stderr as std[f377252fd1978e75]::io::Write>::write_fmt
   3:     0x7f96e3b61638 - std[f377252fd1978e75]::panicking::default_hook::{closure#0}
   4:     0x7f96e3b7e9c3 - std[f377252fd1978e75]::panicking::default_hook
   5:     0x7f96e2b701bc - std[f377252fd1978e75]::panicking::update_hook::<alloc[7d80c8e5f2bc07aa]::boxed::Box<rustc_driver_impl[a7e284e8ff2767b6]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7f96e3b7eca2 - std[f377252fd1978e75]::panicking::panic_with_hook
   7:     0x7f96e3b6172a - std[f377252fd1978e75]::panicking::panic_handler::{closure#0}
   8:     0x7f96e3b58429 - std[f377252fd1978e75]::sys::backtrace::__rust_end_short_backtrace::<std[f377252fd1978e75]::panicking::panic_handler::{closure#0}, !>
   9:     0x7f96e3b6315d - __rustc[d65e30e194c7d9cd]::rust_begin_unwind
  10:     0x7f96e07270cc - core[40ef8ddb62afa269]::panicking::panic_fmt
  11:     0x7f96e02332b2 - core[40ef8ddb62afa269]::panicking::panic
  12:     0x7f96e4cfdde1 - <rustc_symbol_mangling[dce4c7cea9d9bfe9]::v0::V0SymbolMangler as rustc_middle[6d7cfdcb6c95edb7]::ty::print::Printer>::print_type
  13:     0x7f96e4cfeb36 - <rustc_symbol_mangling[dce4c7cea9d9bfe9]::v0::V0SymbolMangler as rustc_middle[6d7cfdcb6c95edb7]::ty::print::Printer>::print_def_path
  14:     0x7f96e4cfa25a - rustc_symbol_mangling[dce4c7cea9d9bfe9]::symbol_name_provider
  15:     0x7f96e4cf9631 - rustc_query_impl[5ff32ada1adb4c7a]::query_impl::symbol_name::invoke_provider_fn::__rust_begin_short_backtrace
  16:     0x7f96e4cf85d2 - rustc_query_impl[5ff32ada1adb4c7a]::execution::try_execute_query::<rustc_middle[6d7cfdcb6c95edb7]::query::caches::DefaultCache<rustc_middle[6d7cfdcb6c95edb7]::ty::instance::Instance, rustc_middle[6d7cfdcb6c95edb7]::query::erase::ErasedData<[u8; 16usize]>>, false>
  17:     0x7f96e4cf8240 - rustc_query_impl[5ff32ada1adb4c7a]::query_impl::symbol_name::execute_query_non_incr::__rust_end_short_backtrace
  18:     0x7f96e4cf7a4c - rustc_monomorphize[980ee425a9bb6f45]::partitioning::assert_symbols_are_distinct::<core[40ef8ddb62afa269]::slice::iter::Iter<rustc_middle[6d7cfdcb6c95edb7]::mir::mono::MonoItem>>
  19:     0x7f96e4ad0d0a - rustc_monomorphize[980ee425a9bb6f45]::partitioning::collect_and_partition_mono_items
  20:     0x7f96e4ad0516 - rustc_query_impl[5ff32ada1adb4c7a]::query_impl::collect_and_partition_mono_items::invoke_provider_fn::__rust_begin_short_backtrace
  21:     0x7f96e54b88a4 - rustc_query_impl[5ff32ada1adb4c7a]::execution::try_execute_query::<rustc_middle[6d7cfdcb6c95edb7]::query::caches::SingleCache<rustc_middle[6d7cfdcb6c95edb7]::query::erase::ErasedData<[u8; 24usize]>>, false>
  22:     0x7f96e54b863c - rustc_query_impl[5ff32ada1adb4c7a]::query_impl::collect_and_partition_mono_items::execute_query_non_incr::__rust_end_short_backtrace
  23:     0x7f96e55a3639 - rustc_codegen_ssa[1989ede88636deb3]::base::codegen_crate::<rustc_codegen_llvm[126abe350048c0c7]::LlvmCodegenBackend>
  24:     0x7f96e55a334d - <rustc_codegen_llvm[126abe350048c0c7]::LlvmCodegenBackend as rustc_codegen_ssa[1989ede88636deb3]::traits::backend::CodegenBackend>::codegen_crate
  25:     0x7f96e546dd7a - <rustc_interface[5f8c59f625471e6f]::queries::Linker>::codegen_and_build_linker
  26:     0x7f96e5468841 - rustc_interface[5f8c59f625471e6f]::interface::run_compiler::<(), rustc_driver_impl[a7e284e8ff2767b6]::run_compiler::{closure#0}>::{closure#1}
  27:     0x7f96e549ba7e - std[f377252fd1978e75]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[5f8c59f625471e6f]::util::run_in_thread_with_globals<rustc_interface[5f8c59f625471e6f]::util::run_in_thread_pool_with_globals<rustc_interface[5f8c59f625471e6f]::interface::run_compiler<(), rustc_driver_impl[a7e284e8ff2767b6]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  28:     0x7f96e549c320 - <std[f377252fd1978e75]::thread::lifecycle::spawn_unchecked<rustc_interface[5f8c59f625471e6f]::util::run_in_thread_with_globals<rustc_interface[5f8c59f625471e6f]::util::run_in_thread_pool_with_globals<rustc_interface[5f8c59f625471e6f]::interface::run_compiler<(), rustc_driver_impl[a7e284e8ff2767b6]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[40ef8ddb62afa269]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  29:     0x7f96e549d1ac - <std[f377252fd1978e75]::sys::thread::unix::Thread>::new::thread_start
  30:     0x7f96defd6609 - start_thread
                               at /build/glibc-B3wQXB/glibc-2.31/nptl/pthread_create.c:477:8
  31:     0x7f96deefb353 - clone
                               at /build/glibc-B3wQXB/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95:0
  32:                0x0 - <unknown>

error: 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

query stack during panic:
#0 [symbol_name] computing the symbol for `core::mem::zeroed::<unsafe<'a> &'a ()>`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
warning: 1 warning emitted

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-name-manglingArea: Name mangling / decoration aka symbol manglingC-bugCategory: This is a bug.F-unsafe_binders`#![feature(unsafe_binders)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions