Skip to content

[ICE]: place local already assigned to #164207

Open

Description

@bjorn3

Code

Run Gankra/abi-cafe@94d3803 on x86_64-pc-windows-msvc

https://github.com/rust-lang/rustc_codegen_cranelift/actions/runs/38254284770/job/114828214547

Meta

rustc --version --verbose:

rustc 1.101.0-nightly (080cc2714 2026-10-11)
binary: rustc
commit-hash: 080cc27146389dbb5c8772c476b1937be9c6110f
commit-date: 2026-10-11
host: x86_64-pc-windows-msvc
release: 1.101.0-nightly
LLVM version: 23.1.3

Error output

error: internal compiler error: /rustc-dev/080cc27146389dbb5c8772c476b1937be9c6110f/compiler/rustc_codegen_ssa\src\mir\block.rs:2482:21: place local already assigned to
Backtrace

thread 'rustc' (8124) panicked at /rustc-dev/080cc27146389dbb5c8772c476b1937be9c6110f/compiler/rustc_codegen_ssa\src\mir\block.rs:2482:21:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_span::macros::ExplicitBug>
   1: rustc_span::macros::bug_impl
   2: <alloc::raw_vec::RawVec<&rustc_codegen_llvm::llvm::ffi::Type>>::grow_one
   3: <hashbrown::raw::RawTable<((&rustc_codegen_llvm::llvm::ffi::Metadata, usize), &rustc_codegen_llvm::llvm::ffi::Metadata)>>::reserve_rehash::<hashbrown::map::make_hasher<(&rustc_codegen_llvm::llvm::ffi::Metadata, usize), &rustc_codegen_llvm::llvm::ffi::Metadata, rustc_hash::FxBuildHasher>::{closure#0}>
   4: <alloc::raw_vec::RawVec<&rustc_codegen_llvm::llvm::ffi::Type>>::grow_one
   5: <rustc_codegen_llvm::back::llvm_backend::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods>::compile_codegen_unit
   6: <rustc_interface::passes::LintStoreExpandImpl as rustc_expand::base::LintStoreExpand>::pre_expansion_lint
   7: <rustc_codegen_llvm::back::llvm_backend::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
   8: <rustc_interface::queries::Linker>::codegen_and_build_linker
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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: please make sure that you have updated to the latest nightly

note: please attach the file at `D:\a\rustc_codegen_cranelift\rustc_codegen_cranelift\build\abi-cafe\rustc-ice-2026-10-12T13_20_42-6808.txt` to your bug report

note: rustc 1.101.0-nightly (080cc2714 2026-10-11) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type staticlib

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

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

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 Oct 12, 2026
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 12, 2026
  3. added
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    on Oct 12, 2026
  4. tmiasko commented on Oct 12, 2026

    @tmiasko
    Contributor
    #[repr(C)]
    pub struct A { }
    
    unsafe extern "C" {
        fn g(_: A) -> A;
    }
    
     pub unsafe fn f(a: A) -> A {
        g(a)
    }

    Potentially related to changes from #156112 (cc @Jules-Bertholet)

  5. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 13, 2026
  6. Jules-Bertholet commented on Oct 13, 2026

    @Jules-Bertholet
    Contributor

    Smaller:

    #[repr(C)]
    pub struct A {}
    
    unsafe extern "C" {
        fn g() -> A;
    }
    
    pub unsafe fn f() -> A {
        g()
    }

    Yes, #156112 is the culprit. Apparently rustc_codegen_ssa doesn't support returning a ZST by pointer. I do not know that part of the codebase at all, so no idea how to fix it :(

    We are ICEing where we would previously generate a function with the wrong ABI, so I don't think this is too urgent to fix.

    @rustbot label A-ABI

  7. added
    A-ABIArea: Concerning the application binary interface (ABI)
    on Oct 13, 2026
  8. added
    S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
    A-FFIArea: Foreign function interface (FFI)
    A-ZSTArea: Zero-sized types (ZSTs).
    A-reprArea: the `#[repr(stuff)]` attribute
    and removed
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 13, 2026
  9. theemathas commented on Oct 13, 2026

    @theemathas
    Contributor

    Possibly related issue: #161117

  10. bjorn3 commented on Oct 13, 2026

    @bjorn3
    MemberAuthor

    Worked around this in rust-lang/rustc_codegen_cranelift@2582170 by ignoring the respective test on MSVC.

  11. added
    P-highHigh priority
    and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 13, 2026
  12. rustbot commented on Oct 13, 2026

    @rustbot
    Collaborator

    Assigning P-high (discussion on Zulip).

  13. deleted a comment from rustbot on Oct 15, 2026
  14. deleted a comment from rustbot on Oct 15, 2026
  15. apiraino commented on Oct 15, 2026

    @apiraino
    Contributor

    @Jules-Bertholet @oli-obk would it make sense reverting temporarily #156112?

  16. Jules-Bertholet commented on Oct 15, 2026

    @Jules-Bertholet
    Contributor

    I don't think so. Again, this isn't "works → ICE", but "silently broken ABI → ICE". If we do revert, it should be a partial revert affecting only return types

  17. apiraino commented on Oct 15, 2026

    @apiraino
    Contributor

    understood, thanks (sorry I missed the full context in your previous comment). we can then downgrade to

    @rustbot label -p-high p-medium

  18. added and removed
    P-highHigh priority
    on Oct 15, 2026
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-ABIArea: Concerning the application binary interface (ABI)A-FFIArea: Foreign function interface (FFI)A-ZSTArea: Zero-sized types (ZSTs).A-reprArea: the `#[repr(stuff)]` attributeC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️O-windows-msvcToolchain: MSVC, Operating system: WindowsP-mediumMedium priorityS-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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions